diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerCommandImpl.kt b/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerCommandImpl.kt index d3c0ab6967ee..eab84fe8f22e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerCommandImpl.kt +++ b/java/debugger/impl/src/com/intellij/debugger/engine/events/DebuggerCommandImpl.kt @@ -47,6 +47,7 @@ abstract class DebuggerCommandImpl(private val myPriority: PrioritizedTask.Prior override fun getPriority() = myPriority + @ApiStatus.Internal fun notifyCancelled() { try { commandCancelled() @@ -72,9 +73,11 @@ abstract class DebuggerCommandImpl(private val myPriority: PrioritizedTask.Prior } } + @ApiStatus.Internal protected open fun onSuspendOrFinish() { } + @ApiStatus.Internal protected open fun invokeContinuation() { executeContinuation() } @@ -88,6 +91,8 @@ abstract class DebuggerCommandImpl(private val myPriority: PrioritizedTask.Prior } internal fun resetContinuation(runnable: Runnable?): Runnable? = continuation.getAndSet(runnable) + + @ApiStatus.Internal protected fun executeContinuation() { resetContinuation(null)?.run() } diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.kt b/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.kt index 0b4a425e6fb9..ae447d52285d 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.kt +++ b/java/debugger/impl/src/com/intellij/debugger/engine/events/SuspendContextCommandImpl.kt @@ -22,7 +22,7 @@ abstract class SuspendContextCommandImpl protected constructor(open val suspendC @ApiStatus.Experimental open suspend fun contextActionSuspend(suspendContext: SuspendContextImpl) = contextAction(suspendContext) - override suspend fun actionSuspend() { + final override suspend fun actionSuspend() { if (LOG.isDebugEnabled) { LOG.debug("trying $this") } @@ -45,7 +45,7 @@ abstract class SuspendContextCommandImpl protected constructor(open val suspendC check(resetContinuation(null) == null) { "Continuation is not null after resume" } } - override fun invokeContinuation() = invokeWithChecks { + final override fun invokeContinuation() = invokeWithChecks { executeContinuation() } @@ -83,7 +83,7 @@ abstract class SuspendContextCommandImpl protected constructor(open val suspendC } } - override fun onSuspendOrFinish() { + final override fun onSuspendOrFinish() { if (mySuspendContextSetInProgress) { suspendContext?.myInProgress = false }