提交 f43307aa 编写于 作者: I isidor

run to cursor: If the cursor is on a line different than the one the debugger...

run to cursor: If the cursor is on a line different than the one the debugger is currently paused on, then send the breakpoint at column 0 on the line otherwise set it at the precise column

fixes #102199
上级 038573aa
...@@ -144,7 +144,15 @@ export class RunToCursorAction extends EditorAction { ...@@ -144,7 +144,15 @@ export class RunToCursorAction extends EditorAction {
const uri = editor.getModel().uri; const uri = editor.getModel().uri;
const bpExists = !!(debugService.getModel().getBreakpoints({ column: position.column, lineNumber: position.lineNumber, uri }).length); const bpExists = !!(debugService.getModel().getBreakpoints({ column: position.column, lineNumber: position.lineNumber, uri }).length);
if (!bpExists) { if (!bpExists) {
const breakpoints = await debugService.addBreakpoints(uri, [{ lineNumber: position.lineNumber, column: position.column }], 'debugEditorActions.runToCursorAction'); let column = 0;
const focusedStackFrame = debugService.getViewModel().focusedStackFrame;
if (focusedStackFrame && focusedStackFrame.source.uri.toString() === uri.toString() && focusedStackFrame.range.startLineNumber === position.lineNumber) {
// If the cursor is on a line different than the one the debugger is currently paused on, then send the breakpoint at column 0 on the line
// otherwise set it at the precise column #102199
column = position.column;
}
const breakpoints = await debugService.addBreakpoints(uri, [{ lineNumber: position.lineNumber, column }], 'debugEditorActions.runToCursorAction');
if (breakpoints && breakpoints.length) { if (breakpoints && breakpoints.length) {
breakpointToRemove = breakpoints[0]; breakpointToRemove = breakpoints[0];
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册