Skip to content

Commit

Permalink
debug - fix active line for column-free breakpoints not be decorated …
Browse files Browse the repository at this point in the history
…correctly

In #81718 we adjusted breakpoint display logic to show an 'empty' arrow on the
line, and the arrow with a dot at the column where the debugger is running.
However, not all debuggers support column breakpoints. Bowden noticed, while
working on his Python demo for ignite, that breakpoints in Python code no
longer displayed correctly.

This PR tweaks the logic so that if we see a breakpoint that doesn't have
an associated column, we show the arrow with a dot on the line, rather than
assuming that there'll be an inline indicator arrow.
  • Loading branch information
connor4312 committed Nov 1, 2019
1 parent 77607b3 commit a14de79
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 12 additions & 5 deletions src/vs/workbench/contrib/debug/browser/breakpointsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,11 +711,18 @@ export function getBreakpointMessageAndClassName(debugService: IDebugService, br
if (focusedThread) {
const callStack = focusedThread ? focusedThread.getCallStack() : undefined;
const topStackFrame = callStack ? callStack[0] : undefined;
if (topStackFrame && topStackFrame.source.uri.toString() === breakpoint.uri.toString() && topStackFrame.range.startLineNumber === breakpoint.lineNumber && topStackFrame.range.startColumn === breakpoint.column) {
return {
className: 'debug-breakpoint-and-top-stack-frame',
message: breakpoint.message || nls.localize('breakpoint', "Breakpoint")
};
if (topStackFrame && topStackFrame.source.uri.toString() === breakpoint.uri.toString() && topStackFrame.range.startLineNumber === breakpoint.lineNumber) {
if (topStackFrame.range.startColumn === breakpoint.column) {
return {
className: 'debug-breakpoint-and-top-stack-frame-at-column',
message: breakpoint.message || nls.localize('breakpoint', "Breakpoint")
};
} else if (breakpoint.column === undefined) {
return {
className: 'debug-breakpoint-and-top-stack-frame',
message: breakpoint.message || nls.localize('breakpoint', "Breakpoint")
};
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
background: url('breakpoint-unsupported.svg') center center no-repeat;
}

.monaco-editor .inline-breakpoint-widget.debug-breakpoint-and-top-stack-frame {
.monaco-editor .debug-top-stack-frame.debug-breakpoint-and-top-stack-frame,
.monaco-editor .inline-breakpoint-widget.debug-breakpoint-and-top-stack-frame-at-column {
background: url('current-and-breakpoint.svg') center center no-repeat;
}

Expand Down

0 comments on commit a14de79

Please sign in to comment.