IDEA-382285 Groovy: cannot step into methods anymore

(cherry picked from commit 3c0ee1c4b48cb04e6e1ed8755fa36252123ae0e6)

IJ-CR-182932

GitOrigin-RevId: 6ac449fb3da473def7add54ee223c9a2c403b128
This commit is contained in:
Egor Ushakov
2025-11-19 12:55:23 +01:00
committed by intellij-monorepo-bot
parent d34c096026
commit 6fee9c96de

View File

@@ -15,7 +15,6 @@ import com.intellij.xdebugger.impl.XDebugSessionImpl
import com.intellij.xdebugger.stepping.ForceSmartStepIntoSource
import com.intellij.xdebugger.stepping.XSmartStepIntoHandler
import com.intellij.xdebugger.stepping.XSmartStepIntoVariant
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.future.future
import org.jetbrains.concurrency.Promise
import org.jetbrains.concurrency.asPromise
@@ -34,10 +33,10 @@ internal class JvmSmartStepIntoActionHandler(private val session: DebuggerSessio
private fun findVariants(xPosition: XSourcePosition, smart: Boolean): Promise<List<JvmSmartStepIntoVariant>> {
val scope = (session.xDebugSession as XDebugSessionImpl).currentSuspendCoroutineScope ?: return rejectedPromise()
val position = DebuggerUtilsEx.toSourcePosition(xPosition, session.project)
val handler = JvmSmartStepIntoHandler.EP_NAME.findFirstSafe { it.isAvailable(position) }
?: return rejectedPromise()
return scope.future {
val position = DebuggerUtilsEx.toSourcePosition(xPosition, session.project)
val handler = JvmSmartStepIntoHandler.EP_NAME.findFirstSafe { it.isAvailable(position) }
?: throw CancellationException()
val targetsPromise = if (smart) handler.findSmartStepTargetsAsync(position, session) else handler.findStepIntoTargets(position, session)
val targets = targetsPromise.await()
readAction { targets.map { JvmSmartStepIntoVariant(it, handler) } }