Compare commits

...

3 Commits

4 changed files with 29 additions and 3 deletions

View File

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

View File

@ -17,7 +17,7 @@ class PluginLoadListener : DynamicPluginListener {
}
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.")
}
}

View File

@ -13,9 +13,30 @@ class PreventHidingPopups : StartupActivity {
}
companion object {
private var isInstalled = false
fun installListener() {
if (isInstalled) {
return
}
EditorMouseHoverPopupManager.getInstance() // Installs the default listener.
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() {

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.
<br><br>
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>
<a href="https://youtrack.jetbrains.com/issue/IDEA-120435">IDEA-120435</a>
]]></description>
<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>
<li>Renamed the plugin to "Keep Editor Tooltips While Debugging" and updated description.</li>
</ul>