mirror of
https://github.com/chylex/IntelliJ-Keep-Editor-Tooltips-While-Debugging.git
synced 2024-11-25 10:42:46 +01:00
Compare commits
3 Commits
43857c2f7f
...
5a59a26bbb
Author | SHA1 | Date | |
---|---|---|---|
5a59a26bbb | |||
fe7a20920c | |||
b9a8bdaeba |
@ -8,7 +8,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "com.chylex.intellij.keeppopupswhiledebugging"
|
||||
version = "1.0.1"
|
||||
version = "1.1"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
@ -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.")
|
||||
}
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user