From a14de79ac74f2e0e6566d3cc9410eeb7dc769cde Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Fri, 1 Nov 2019 11:24:27 -0700 Subject: [PATCH] debug - fix active line for column-free breakpoints not be decorated 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. --- .../contrib/debug/browser/breakpointsView.ts | 17 ++++++++++++----- .../debug/browser/media/debug.contribution.css | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts index 295cbf41b0f6e..aad8c7e6944a2 100644 --- a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts +++ b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts @@ -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") + }; + } } } diff --git a/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css b/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css index bdee92f212891..3ab961601acd8 100644 --- a/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css +++ b/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css @@ -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; }