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
This commit is contained in:
Leonid Shalupov
2022-12-29 19:33:00 +00:00
committed by intellij-monorepo-bot
parent 8e7959c994
commit d941103020
3 changed files with 6 additions and 15 deletions
@@ -223,10 +223,9 @@ class InlayHintsPass(
if (!isAcceptablePlacement(placement)) {
throw IllegalArgumentException()
}
SlowOperations.allowSlowOperations<Exception> {
@Suppress("UNCHECKED_CAST")
addOrUpdate(new as List<ConstrainedPresentation<*, Constraints>>, editor, factory)
}
@Suppress("UNCHECKED_CAST")
addOrUpdate(new as List<ConstrainedPresentation<*, Constraints>>, editor, factory)
}
}
}
@@ -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<Exception> {
SlowOperations.allowSlowOperations(SlowOperations.ACTION_PERFORM).use {
renderer.mouseClicked(event, translated)
}
}
@@ -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<Exception> {
container.mouseMoved(event, translated)
}
container.mouseMoved(event, translated)
}
private fun exitMouseInActiveContainer() {
val container = activeContainer
if (container != null) {
SlowOperations.allowSlowOperations<Exception> {
container.mouseExited()
}
}
activeContainer?.mouseExited()
}
}