Allow themeing of debug single step line highlight

fixes #44030
This commit is contained in:
isidor
2018-10-04 12:08:03 +02:00
parent 10a1d2a50a
commit b5822be243
3 changed files with 20 additions and 43 deletions
@@ -12,6 +12,9 @@ import { IDebugService, IBreakpoint, State, IBreakpointUpdateData } from 'vs/wor
import { IModelService } from 'vs/editor/common/services/modelService';
import { MarkdownString } from 'vs/base/common/htmlContent';
import { getBreakpointMessageAndClassName } from 'vs/workbench/parts/debug/browser/breakpointsView';
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { registerColor } from 'vs/platform/theme/common/colorRegistry';
import { localize } from 'vs/nls';
interface IBreakpointDecoration {
decorationId: string;
@@ -334,3 +337,19 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
stickiness: DebugEditorModelManager.STICKINESS
};
}
registerThemingParticipant((theme, collector) => {
const topStackFrame = theme.getColor(topStackFrameColor);
if (topStackFrame) {
collector.addRule(`.monaco-editor .view-overlays .debug-top-stack-frame-line { background: ${topStackFrame}; }`);
collector.addRule(`.monaco-editor .view-overlays .debug-top-stack-frame-exception-line { background: ${topStackFrame}; }`);
}
const focusedStackFrame = theme.getColor(focusedStackFrameColor);
if (focusedStackFrame) {
collector.addRule(`.monaco-editor .view-overlays .debug-focused-stack-frame-line { background: ${focusedStackFrame}; }`);
}
});
const topStackFrameColor = registerColor('editor.debugStackFrameLineHighlight', { dark: '#ffff0033', light: '#ffff6673', hc: '#fff600' }, localize('topStackFrameLineHighlight', 'Background color for the highlight of line at the top stack frame position.'));
const focusedStackFrameColor = registerColor('editor.debugFocusedStackFrameLineHighlight', { dark: '#7abd7a4d', light: '#cee7ce73', hc: '#cee7ce' }, localize('focusedStackFrameLineHighlight', 'Background color for the highlight of line at focused stack frame position.'));
@@ -9,27 +9,10 @@
-webkit-mask-size: 28px;
}
.monaco-editor .debug-top-stack-frame-line,
.monaco-editor .debug-top-stack-frame-exception-line {
background: rgba(255, 255, 102, 0.45);
}
.monaco-editor .debug-top-stack-frame-range {
background: rgba(255, 255, 102, 0.6);
}
.monaco-editor .debug-top-stack-frame-column::before {
background: url('current-arrow.svg') center center no-repeat;
}
.monaco-editor .debug-focused-stack-frame-line {
background: rgba(206, 231, 206, 0.45);
}
.monaco-editor .debug-focused-stack-frame-range {
background: rgba(206, 231, 206, 1);
}
.debug-breakpoint-hint {
background: url('breakpoint-hint.svg') center center no-repeat;
}
@@ -242,37 +225,12 @@
color: #C586C0;
}
.monaco-editor.vs-dark .debug-focused-stack-frame-line {
background: rgba(122, 189, 122, 0.3);
}
.monaco-editor.vs-dark .debug-focused-stack-frame-range {
background: rgba(122, 189, 122, 0.5);
}
.monaco-editor.vs-dark .debug-top-stack-frame-line,
.monaco-editor.vs-dark .debug-top-stack-frame-exception-line {
background-color: rgba(255, 255, 0, 0.2)
}
.monaco-editor.vs-dark .debug-top-stack-frame-range {
background-color: rgba(255, 255, 0, 0.3)
}
/* High Contrast Theming */
.monaco-editor.hc-black .debug-focused-stack-frame-line {
background: rgba(206, 231, 206, 1);
}
.hc-black .monaco-workbench .monaco-tree-row:not(.selected) .expression .name {
color: inherit;
}
.hc-black .monaco-editor .debug-top-stack-frame-line {
background: rgba(255, 246, 0, 1);
}
.hc-black .monaco-editor .debug-remove-token-colors {
color:black;
}
@@ -500,7 +500,7 @@ export class DebugService implements IDebugService {
private registerSessionListeners(session: IDebugSession): void {
const sessionRunningScheduler = new RunOnceScheduler(() => {
// Do not immediatly focus another session or thread if a session is running
// Stepping in a session should preserve that session focussed even if some continued events happen
// Stepping in a session should preserve that session focused even if some continued events happen
if (session.state === State.Running && this.viewModel.focusedSession === session) {
this.focusStackFrame(undefined);
}