[java-decompiler] format DecompilerInEditorListener

GitOrigin-RevId: 95944d138ca7ad71d0a5d4aa686b3dc42c535ef6
This commit is contained in:
Bartek Pacia
2025-10-31 18:54:03 +00:00
committed by intellij-monorepo-bot
parent 49c4674e71
commit 10e30ff2cb
@@ -9,7 +9,6 @@ import com.intellij.openapi.actionSystem.Presentation
import com.intellij.openapi.actionSystem.impl.ActionButton
import com.intellij.openapi.editor.event.EditorFactoryEvent
import com.intellij.openapi.editor.event.EditorFactoryListener
import com.intellij.openapi.editor.ex.EditorMarkupModel
import com.intellij.openapi.editor.impl.EditorImpl
import com.intellij.openapi.editor.impl.EditorInspectionsActionToolbar
import com.intellij.openapi.editor.impl.EditorMarkupModelImpl
@@ -33,22 +32,6 @@ private class DecompilerInEditorListener : EditorFactoryListener {
setupModeToggles(editor)
}
/**
* This is a hack. See IDEA-368466.
*
* We want to add an icon to the small toolbar in the upper-right corner of the editor (aka "the inspection widget").
*
* Normal, well-behaved plugins (for example GitHub plugin, for code review), contribute their own actions to the
* inspection widget by calling [EditorMarkupModel.addInspectionWidgetAction].
*
* Unfortunately, we cannot act like a well-behaved plugin because the inspection widget is not shown for
* class files (and other binary artifacts). This assumption is hardcoded quite deep in platform code.
*
* Therefore, we replace the whole "status component" (which itself is a part of [JBScrollPane]).
*
* We assume we will not overwrite any existing UI that was already there – because there wasn't any UI to be
* overwritten – recall that the whole "status component" is not displayed for class files (and other binary artifacts).
*/
private fun setupModeToggles(editor: EditorImpl) {
val decompilerSettings = IdeaDecompilerSettings.getInstance()