From d941103020cec2e75e1f4e8daf4101b7d214d043 Mon Sep 17 00:00:00 2001 From: Leonid Shalupov Date: Thu, 29 Dec 2022 16:59:11 +0100 Subject: [PATCH] IDEA-305610 Get rid of `SlowOperations` wrapping - InlayEditorMouseListener On click converted to SlowOperations.ACTION_PERFORM, wrapping around mouse move removed to collect real exceptions ref IDEA-305609 Get rid of `SlowOperations` wrapping - InlayHintsPass.Companion#addOrUpdate GitOrigin-RevId: 0c8071342c008ac3e67369c1928d472214a86c23 --- .../com/intellij/codeInsight/hints/InlayHintsPass.kt | 7 +++---- .../listeners/InlayEditorMouseListener.kt | 2 +- .../listeners/InlayEditorMouseMotionListener.kt | 12 ++---------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hints/InlayHintsPass.kt b/platform/lang-impl/src/com/intellij/codeInsight/hints/InlayHintsPass.kt index 5edf07dc16be..03652d9d5184 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hints/InlayHintsPass.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/hints/InlayHintsPass.kt @@ -223,10 +223,9 @@ class InlayHintsPass( if (!isAcceptablePlacement(placement)) { throw IllegalArgumentException() } - SlowOperations.allowSlowOperations { - @Suppress("UNCHECKED_CAST") - addOrUpdate(new as List>, editor, factory) - } + + @Suppress("UNCHECKED_CAST") + addOrUpdate(new as List>, editor, factory) } } } \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/listeners/InlayEditorMouseListener.kt b/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/listeners/InlayEditorMouseListener.kt index 96821559df64..53317abfc5f2 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/listeners/InlayEditorMouseListener.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/listeners/InlayEditorMouseListener.kt @@ -22,7 +22,7 @@ class InlayEditorMouseListener : EditorMouseListener { val bounds = inlay.bounds ?: return val inlayPoint = Point(bounds.x, bounds.y) val translated = Point(event.x - inlayPoint.x, event.y - inlayPoint.y) - SlowOperations.allowSlowOperations { + SlowOperations.allowSlowOperations(SlowOperations.ACTION_PERFORM).use { renderer.mouseClicked(event, translated) } } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/listeners/InlayEditorMouseMotionListener.kt b/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/listeners/InlayEditorMouseMotionListener.kt index 295c9199a1ef..ef2edfa9df57 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/listeners/InlayEditorMouseMotionListener.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/listeners/InlayEditorMouseMotionListener.kt @@ -5,7 +5,6 @@ import com.intellij.codeInsight.hints.presentation.InputHandler import com.intellij.openapi.editor.event.EditorMouseEvent import com.intellij.openapi.editor.event.EditorMouseEventArea import com.intellij.openapi.editor.event.EditorMouseMotionListener -import com.intellij.util.SlowOperations import java.awt.Point class InlayEditorMouseMotionListener : EditorMouseMotionListener { @@ -34,17 +33,10 @@ class InlayEditorMouseMotionListener : EditorMouseMotionListener { val bounds = inlay.bounds ?: return val inlayPoint = Point(bounds.x, bounds.y) val translated = Point(event.x - inlayPoint.x, event.y - inlayPoint.y) - SlowOperations.allowSlowOperations { - container.mouseMoved(event, translated) - } + container.mouseMoved(event, translated) } private fun exitMouseInActiveContainer() { - val container = activeContainer - if (container != null) { - SlowOperations.allowSlowOperations { - container.mouseExited() - } - } + activeContainer?.mouseExited() } } \ No newline at end of file