From 4ff346caa255ea16965f92d4c85077ee2a918483 Mon Sep 17 00:00:00 2001 From: "Ivan.Yarkov" Date: Wed, 9 Apr 2025 17:27:10 +0300 Subject: [PATCH] RIDER-124493 perform "smart step into" enter handler on frontend to avoid executing it on backend (cherry picked from commit 7ded5cb2306edfd12f7cdb8478d6c4c23a8b3faf) IJ-MR-159874 GitOrigin-RevId: 8af6ca0949e15fd56b578558abb2bb218d591ecc --- .../handlers/XDebuggerSmartStepIntoHandler.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerSmartStepIntoHandler.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerSmartStepIntoHandler.java index 576e4d87661f..cd771a184592 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerSmartStepIntoHandler.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerSmartStepIntoHandler.java @@ -445,9 +445,8 @@ public class XDebuggerSmartStepIntoHandler extends XDebuggerSuspendedActionHandl @Override protected void doExecute(@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { - SmartStepData stepData = editor.getUserData(SMART_STEP_INPLACE_DATA); - if (stepData != null) { - myPerform(editor, caret, dataContext, stepData); + if (hasSmartStepDebugData(editor)) { + myPerform(editor, caret, dataContext, editor.getUserData(SMART_STEP_INPLACE_DATA)); } else { myOriginalHandler.execute(editor, caret, dataContext); @@ -456,7 +455,11 @@ public class XDebuggerSmartStepIntoHandler extends XDebuggerSuspendedActionHandl @Override protected boolean isEnabledForCaret(@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { - return editor.getUserData(SMART_STEP_INPLACE_DATA) != null || myOriginalHandler.isEnabled(editor, caret, dataContext); + return hasSmartStepDebugData(editor) || myOriginalHandler.isEnabled(editor, caret, dataContext); + } + + protected boolean hasSmartStepDebugData(@NotNull Editor editor) { + return editor.getUserData(SMART_STEP_INPLACE_DATA) != null; } protected abstract void myPerform(@NotNull Editor editor, @@ -538,8 +541,9 @@ public class XDebuggerSmartStepIntoHandler extends XDebuggerSuspendedActionHandl } } - static final class EnterHandler extends SmartStepEditorActionHandler { - EnterHandler(EditorActionHandler original) { + @ApiStatus.Internal + public static class EnterHandler extends SmartStepEditorActionHandler { + public EnterHandler(EditorActionHandler original) { super(original); }