1
0

Compare commits

..

4 Commits

Author SHA1 Message Date
20148c0ed5 Create FUNDING.yml 2023-01-10 12:33:39 +01:00
5a59a26bbb Release 1.1 2022-07-20 23:15:07 +02:00
fe7a20920c Fix listener being installed multiple times 2022-07-20 23:15:07 +02:00
b9a8bdaeba Support disabling or uninstalling the plugin without an IDE restart 2022-07-20 22:52:39 +02:00
5 changed files with 32 additions and 3 deletions

3
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,3 @@
github: chylex
patreon: chylex
ko_fi: chylex

View File

@@ -8,7 +8,7 @@ plugins {
} }
group = "com.chylex.intellij.keeppopupswhiledebugging" group = "com.chylex.intellij.keeppopupswhiledebugging"
version = "1.0.1" version = "1.1"
repositories { repositories {
mavenCentral() mavenCentral()

View File

@@ -17,7 +17,7 @@ class PluginLoadListener : DynamicPluginListener {
} }
override fun beforePluginUnload(pluginDescriptor: IdeaPluginDescriptor, isUpdate: Boolean) { override fun beforePluginUnload(pluginDescriptor: IdeaPluginDescriptor, isUpdate: Boolean) {
if (pluginDescriptor.pluginId.idString == PLUGIN_ID) { if (pluginDescriptor.pluginId.idString == PLUGIN_ID && !PreventHidingPopups.tryUninstallListener()) {
throw CannotUnloadPluginException("A restart is required to unload Keep Editor Tooltips While Debugging plugin.") throw CannotUnloadPluginException("A restart is required to unload Keep Editor Tooltips While Debugging plugin.")
} }
} }

View File

@@ -13,9 +13,30 @@ class PreventHidingPopups : StartupActivity {
} }
companion object { companion object {
private var isInstalled = false
fun installListener() { fun installListener() {
if (isInstalled) {
return
}
EditorMouseHoverPopupManager.getInstance() // Installs the default listener. EditorMouseHoverPopupManager.getInstance() // Installs the default listener.
EditorMouseHoverPopupControl.getInstance()?.addListener(MouseTrackingDisabledListener) EditorMouseHoverPopupControl.getInstance()?.addListener(MouseTrackingDisabledListener)
isInstalled = true
}
fun tryUninstallListener(): Boolean {
val instance = EditorMouseHoverPopupControl.getInstance() ?: return true
return try {
val listenersField = instance.javaClass.getDeclaredField("listeners").also { it.isAccessible = true }
val listeners = listenersField.get(instance) as MutableCollection<*>
listeners.remove(MouseTrackingDisabledListener)
isInstalled = false
true
} catch (e: Exception) {
false
}
} }
fun enablePopupsInAllProjects() { fun enablePopupsInAllProjects() {

View File

@@ -10,12 +10,17 @@
If you hover an element that has tooltips from both the editor and the debugger, both tooltips are shown and moving the cursor on top of one hides the other. If you hover an element that has tooltips from both the editor and the debugger, both tooltips are shown and moving the cursor on top of one hides the other.
<br><br> <br><br>
Installing the plugin automatically re-enables all editor tooltips, even if installed in the middle of a debugging session. Installing the plugin automatically re-enables all editor tooltips, even if installed in the middle of a debugging session.
Disabling or uninstalling the plugin requires an IDE restart. Disabling or uninstalling the plugin takes effect when the next debugging session starts.
<br><br> <br><br>
<a href="https://youtrack.jetbrains.com/issue/IDEA-120435">IDEA-120435</a> <a href="https://youtrack.jetbrains.com/issue/IDEA-120435">IDEA-120435</a>
]]></description> ]]></description>
<change-notes><![CDATA[ <change-notes><![CDATA[
<b>Version 1.1</b>
<ul>
<li>Disabling or uninstalling the plugin no longer requires a restart.</li>
</ul>
<b>Version 1.0.1</b>
<ul> <ul>
<li>Renamed the plugin to "Keep Editor Tooltips While Debugging" and updated description.</li> <li>Renamed the plugin to "Keep Editor Tooltips While Debugging" and updated description.</li>
</ul> </ul>