mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 17:23:40 -05:00
This reverts commit d15a3fcc98.
This commit is contained in:
@@ -221,4 +221,4 @@ export abstract class AbstractExpressionsRenderer implements ITreeRenderer<IExpr
|
||||
disposeTemplate(templateData: IExpressionTemplateData): void {
|
||||
dispose(templateData.toDispose);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Position, IPosition } from 'vs/editor/common/core/position';
|
||||
import { ICodeEditor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { ZoneWidget } from 'vs/editor/contrib/zoneWidget/zoneWidget';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IDebugService, IBreakpoint, BreakpointWidgetContext as Context, CONTEXT_BREAKPOINT_WIDGET_VISIBLE, DEBUG_SCHEME, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, CONTEXT_IN_BREAKPOINT_WIDGET, IBreakpointUpdateData } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { IDebugService, IBreakpoint, BreakpointWidgetContext as Context, CONTEXT_BREAKPOINT_WIDGET_VISIBLE, DEBUG_SCHEME, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, CONTEXT_IN_BREAKPOINT_WIDGET } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
@@ -184,13 +184,13 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakpointWi
|
||||
}
|
||||
|
||||
if (this.breakpoint) {
|
||||
const data = new Map<string, IBreakpointUpdateData>();
|
||||
data.set(this.breakpoint.getId(), {
|
||||
condition,
|
||||
hitCondition,
|
||||
logMessage
|
||||
});
|
||||
this.debugService.updateBreakpoints(this.breakpoint.uri, data, false);
|
||||
this.debugService.updateBreakpoints(this.breakpoint.uri, {
|
||||
[this.breakpoint.getId()]: {
|
||||
condition,
|
||||
hitCondition,
|
||||
logMessage
|
||||
}
|
||||
}, false);
|
||||
} else {
|
||||
const model = this.editor.getModel();
|
||||
if (model) {
|
||||
|
||||
@@ -61,7 +61,7 @@ export class BreakpointsView extends ViewletPanel {
|
||||
super({ ...(options as IViewletPanelOptions), ariaHeaderLabel: nls.localize('breakpointsSection', "Breakpoints Section") }, keybindingService, contextMenuService, configurationService);
|
||||
|
||||
this.minimumBodySize = this.maximumBodySize = this.getExpandedBodySize();
|
||||
this._register(this.debugService.getModel().onDidChangeBreakpoints(() => this.onBreakpointsChange()));
|
||||
this.disposables.push(this.debugService.getModel().onDidChangeBreakpoints(() => this.onBreakpointsChange()));
|
||||
}
|
||||
|
||||
public renderBody(container: HTMLElement): void {
|
||||
@@ -81,9 +81,9 @@ export class BreakpointsView extends ViewletPanel {
|
||||
|
||||
CONTEXT_BREAKPOINTS_FOCUSED.bindTo(this.list.contextKeyService);
|
||||
|
||||
this._register(this.list.onContextMenu(this.onListContextMenu, this));
|
||||
this.list.onContextMenu(this.onListContextMenu, this, this.disposables);
|
||||
|
||||
this._register(this.list.onDidOpen(e => {
|
||||
this.disposables.push(this.list.onDidOpen(e => {
|
||||
let isSingleClick = false;
|
||||
let isDoubleClick = false;
|
||||
let isMiddleClick = false;
|
||||
@@ -120,7 +120,7 @@ export class BreakpointsView extends ViewletPanel {
|
||||
|
||||
this.list.splice(0, this.list.length, this.elements);
|
||||
|
||||
this._register(this.onDidChangeBodyVisibility(visible => {
|
||||
this.disposables.push(this.onDidChangeBodyVisibility(visible => {
|
||||
if (visible && this.needsRefresh) {
|
||||
this.onBreakpointsChange();
|
||||
}
|
||||
@@ -557,6 +557,7 @@ export function openBreakpointSource(breakpoint: IBreakpoint, sideBySide: boolea
|
||||
options: {
|
||||
preserveFocus,
|
||||
selection,
|
||||
revealIfVisible: true,
|
||||
revealIfOpened: true,
|
||||
revealInCenterIfOutsideViewport: true,
|
||||
pinned: !preserveFocus
|
||||
|
||||
@@ -63,7 +63,7 @@ export class CallStackView extends ViewletPanel {
|
||||
this.callStackItemType = CONTEXT_CALLSTACK_ITEM_TYPE.bindTo(contextKeyService);
|
||||
|
||||
this.contributedContextMenu = menuService.createMenu(MenuId.DebugCallStackContext, contextKeyService);
|
||||
this._register(this.contributedContextMenu);
|
||||
this.disposables.push(this.contributedContextMenu);
|
||||
|
||||
// Create scheduler to prevent unnecessary flashing of tree when reacting to changes
|
||||
this.onCallStackChangeScheduler = new RunOnceScheduler(() => {
|
||||
@@ -149,8 +149,8 @@ export class CallStackView extends ViewletPanel {
|
||||
this.tree.setInput(this.debugService.getModel()).then(undefined, onUnexpectedError);
|
||||
|
||||
const callstackNavigator = new TreeResourceNavigator2(this.tree);
|
||||
this._register(callstackNavigator);
|
||||
this._register(callstackNavigator.onDidOpenResource(e => {
|
||||
this.disposables.push(callstackNavigator);
|
||||
this.disposables.push(callstackNavigator.onDidOpenResource(e => {
|
||||
if (this.ignoreSelectionChangedEvent) {
|
||||
return;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ export class CallStackView extends ViewletPanel {
|
||||
}
|
||||
}));
|
||||
|
||||
this._register(this.debugService.getModel().onDidChangeCallStack(() => {
|
||||
this.disposables.push(this.debugService.getModel().onDidChangeCallStack(() => {
|
||||
if (!this.isBodyVisible()) {
|
||||
this.needsRefresh = true;
|
||||
return;
|
||||
@@ -200,7 +200,7 @@ export class CallStackView extends ViewletPanel {
|
||||
}
|
||||
}));
|
||||
const onCallStackChange = Event.any<any>(this.debugService.getViewModel().onDidFocusStackFrame, this.debugService.getViewModel().onDidFocusSession);
|
||||
this._register(onCallStackChange(() => {
|
||||
this.disposables.push(onCallStackChange(() => {
|
||||
if (this.ignoreFocusStackFrameEvent) {
|
||||
return;
|
||||
}
|
||||
@@ -211,20 +211,20 @@ export class CallStackView extends ViewletPanel {
|
||||
|
||||
this.updateTreeSelection();
|
||||
}));
|
||||
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
||||
this.disposables.push(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
||||
|
||||
// Schedule the update of the call stack tree if the viewlet is opened after a session started #14684
|
||||
if (this.debugService.state === State.Stopped) {
|
||||
this.onCallStackChangeScheduler.schedule(0);
|
||||
}
|
||||
|
||||
this._register(this.onDidChangeBodyVisibility(visible => {
|
||||
this.disposables.push(this.onDidChangeBodyVisibility(visible => {
|
||||
if (visible && this.needsRefresh) {
|
||||
this.onCallStackChangeScheduler.schedule();
|
||||
}
|
||||
}));
|
||||
|
||||
this._register(this.debugService.onDidNewSession(s => {
|
||||
this.disposables.push(this.debugService.onDidNewSession(s => {
|
||||
if (s.parentSession) {
|
||||
// Auto expand sessions that have sub sessions
|
||||
this.parentSessionToExpand.add(s.parentSession);
|
||||
|
||||
@@ -5,14 +5,12 @@
|
||||
|
||||
import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector';
|
||||
import { RGBA, Color } from 'vs/base/common/color';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { ansiColorIdentifiers } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry';
|
||||
|
||||
/**
|
||||
* @param text The content to stylize.
|
||||
* @returns An {@link HTMLSpanElement} that contains the potentially stylized text.
|
||||
*/
|
||||
export function handleANSIOutput(text: string, linkDetector: LinkDetector, themeService: IThemeService): HTMLSpanElement {
|
||||
export function handleANSIOutput(text: string, linkDetector: LinkDetector): HTMLSpanElement {
|
||||
|
||||
const root: HTMLSpanElement = document.createElement('span');
|
||||
const textLength: number = text.length;
|
||||
@@ -107,20 +105,23 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
|
||||
/**
|
||||
* Change the foreground or background color by clearing the current color
|
||||
* and adding the new one.
|
||||
* @param newClass If string or number, new class will be
|
||||
* `code-(foreground or background)-newClass`. If `undefined`, no new class
|
||||
* will be added.
|
||||
* @param colorType If `'foreground'`, will change the foreground color, if
|
||||
* `'background'`, will change the background color.
|
||||
* @param color Color to change to. If `undefined` or not provided,
|
||||
* will clear current color without adding a new one.
|
||||
* @param customColor If provided, this custom color will be used instead of
|
||||
* a class-defined color.
|
||||
*/
|
||||
function changeColor(colorType: 'foreground' | 'background', color?: RGBA | undefined): void {
|
||||
if (colorType === 'foreground') {
|
||||
customFgColor = color;
|
||||
} else if (colorType === 'background') {
|
||||
customBgColor = color;
|
||||
function changeColor(newClass: string | number | undefined, colorType: 'foreground' | 'background', customColor?: RGBA): void {
|
||||
styleNames = styleNames.filter(style => !style.match(new RegExp(`^code-${colorType}-(\\d+|custom)$`)));
|
||||
if (newClass) {
|
||||
styleNames.push(`code-${colorType}-${newClass}`);
|
||||
}
|
||||
styleNames = styleNames.filter(style => style !== `code-${colorType}-colored`);
|
||||
if (color !== undefined) {
|
||||
styleNames.push(`code-${colorType}-colored`);
|
||||
if (colorType === 'foreground') {
|
||||
customFgColor = customColor;
|
||||
} else {
|
||||
customBgColor = customColor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,37 +137,22 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
|
||||
*/
|
||||
function setBasicFormatters(styleCodes: number[]): void {
|
||||
for (let code of styleCodes) {
|
||||
switch (code) {
|
||||
case 0: {
|
||||
styleNames = [];
|
||||
customFgColor = undefined;
|
||||
customBgColor = undefined;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
styleNames.push('code-bold');
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
styleNames.push('code-italic');
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
styleNames.push('code-underline');
|
||||
break;
|
||||
}
|
||||
case 39: {
|
||||
changeColor('foreground', undefined);
|
||||
break;
|
||||
}
|
||||
case 49: {
|
||||
changeColor('background', undefined);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
setBasicColor(code);
|
||||
break;
|
||||
}
|
||||
if (code === 0) {
|
||||
styleNames = [];
|
||||
} else if (code === 1) {
|
||||
styleNames.push('code-bold');
|
||||
} else if (code === 3) {
|
||||
styleNames.push('code-italic');
|
||||
} else if (code === 4) {
|
||||
styleNames.push('code-underline');
|
||||
} else if ((code >= 30 && code <= 37) || (code >= 90 && code <= 97)) {
|
||||
changeColor(code, 'foreground');
|
||||
} else if ((code >= 40 && code <= 47) || (code >= 100 && code <= 107)) {
|
||||
changeColor(code, 'background');
|
||||
} else if (code === 39) {
|
||||
changeColor(undefined, 'foreground');
|
||||
} else if (code === 49) {
|
||||
changeColor(undefined, 'background');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,7 +171,7 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
|
||||
styleCodes[3] >= 0 && styleCodes[3] <= 255 &&
|
||||
styleCodes[4] >= 0 && styleCodes[4] <= 255) {
|
||||
const customColor = new RGBA(styleCodes[2], styleCodes[3], styleCodes[4]);
|
||||
changeColor(colorType, customColor);
|
||||
changeColor('custom', colorType, customColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +188,7 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
|
||||
const color = calcANSI8bitColor(colorNumber);
|
||||
|
||||
if (color) {
|
||||
changeColor(colorType, color);
|
||||
changeColor('custom', colorType, color);
|
||||
} else if (colorNumber >= 0 && colorNumber <= 15) {
|
||||
// Need to map to one of the four basic color ranges (30-37, 90-97, 40-47, 100-107)
|
||||
colorNumber += 30;
|
||||
@@ -213,43 +199,7 @@ export function handleANSIOutput(text: string, linkDetector: LinkDetector, theme
|
||||
if (colorType === 'background') {
|
||||
colorNumber += 10;
|
||||
}
|
||||
setBasicColor(colorNumber);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate and set styling for basic bright and dark ANSI color codes. Uses
|
||||
* theme colors if available. Automatically distinguishes between foreground
|
||||
* and background colors; does not support color-clearing codes 39 and 49.
|
||||
* @param styleCode Integer color code on one of the following ranges:
|
||||
* [30-37, 90-97, 40-47, 100-107]. If not on one of these ranges, will do
|
||||
* nothing.
|
||||
*/
|
||||
function setBasicColor(styleCode: number): void {
|
||||
const theme = themeService.getTheme();
|
||||
let colorType: 'foreground' | 'background' | undefined;
|
||||
let colorIndex: number | undefined;
|
||||
|
||||
if (styleCode >= 30 && styleCode <= 37) {
|
||||
colorIndex = styleCode - 30;
|
||||
colorType = 'foreground';
|
||||
} else if (styleCode >= 90 && styleCode <= 97) {
|
||||
colorIndex = (styleCode - 90) + 8; // High-intensity (bright)
|
||||
colorType = 'foreground';
|
||||
} else if (styleCode >= 40 && styleCode <= 47) {
|
||||
colorIndex = styleCode - 40;
|
||||
colorType = 'background';
|
||||
} else if (styleCode >= 100 && styleCode <= 107) {
|
||||
colorIndex = (styleCode - 100) + 8; // High-intensity (bright)
|
||||
colorType = 'background';
|
||||
}
|
||||
|
||||
if (colorIndex !== undefined && colorType) {
|
||||
const colorName = ansiColorIdentifiers[colorIndex];
|
||||
const color = theme.getColor(colorName);
|
||||
if (color) {
|
||||
changeColor(colorType, color.rgba);
|
||||
}
|
||||
changeColor(colorNumber, colorType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,9 +199,9 @@ export class FocusSessionActionViewItem extends SelectActionViewItem {
|
||||
) {
|
||||
super(null, action, [], -1, contextViewService, { ariaLabel: nls.localize('debugSession', 'Debug Session') });
|
||||
|
||||
this._register(attachSelectBoxStyler(this.selectBox, themeService));
|
||||
this.toDispose.push(attachSelectBoxStyler(this.selectBox, themeService));
|
||||
|
||||
this._register(this.debugService.getViewModel().onDidFocusSession(() => {
|
||||
this.toDispose.push(this.debugService.getViewModel().onDidFocusSession(() => {
|
||||
const session = this.debugService.getViewModel().focusedSession;
|
||||
if (session) {
|
||||
const index = this.getSessions().indexOf(session);
|
||||
@@ -209,8 +209,8 @@ export class FocusSessionActionViewItem extends SelectActionViewItem {
|
||||
}
|
||||
}));
|
||||
|
||||
this._register(this.debugService.onDidNewSession(() => this.update()));
|
||||
this._register(this.debugService.onDidEndSession(() => this.update()));
|
||||
this.toDispose.push(this.debugService.onDidNewSession(() => this.update()));
|
||||
this.toDispose.push(this.debugService.onDidEndSession(() => this.update()));
|
||||
|
||||
this.update();
|
||||
}
|
||||
|
||||
@@ -53,11 +53,6 @@ function getThreadAndRun(accessor: ServicesAccessor, thread: IThread | undefined
|
||||
const debugService = accessor.get(IDebugService);
|
||||
if (!(thread instanceof Thread)) {
|
||||
thread = debugService.getViewModel().focusedThread;
|
||||
if (!thread) {
|
||||
const focusedSession = debugService.getViewModel().focusedSession;
|
||||
const threads = focusedSession ? focusedSession.getAllThreads() : undefined;
|
||||
thread = threads && threads.length ? threads[0] : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
if (thread) {
|
||||
@@ -412,18 +407,24 @@ export function registerCommands(): void {
|
||||
const widget = editorService.activeTextEditorWidget;
|
||||
if (isCodeEditor(widget)) {
|
||||
const position = widget.getPosition();
|
||||
if (position && widget.hasModel() && debugService.getConfigurationManager().canSetBreakpointsIn(widget.getModel())) {
|
||||
const modelUri = widget.getModel().uri;
|
||||
const breakpointAlreadySet = debugService.getModel().getBreakpoints({ lineNumber: position.lineNumber, uri: modelUri })
|
||||
.some(bp => (bp.sessionAgnosticData.column === position.column || (!bp.column && position.column <= 1)));
|
||||
if (!position || !widget.hasModel()) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (!breakpointAlreadySet) {
|
||||
debugService.addBreakpoints(modelUri, [{ lineNumber: position.lineNumber, column: position.column > 1 ? position.column : undefined }], 'debugCommands.inlineBreakpointCommand');
|
||||
}
|
||||
const modelUri = widget.getModel().uri;
|
||||
const bp = debugService.getModel().getBreakpoints({ lineNumber: position.lineNumber, uri: modelUri })
|
||||
.filter(bp => (bp.column === position.column || !bp.column && position.column <= 1)).pop();
|
||||
|
||||
if (bp) {
|
||||
return undefined;
|
||||
}
|
||||
if (debugService.getConfigurationManager().canSetBreakpointsIn(widget.getModel())) {
|
||||
return debugService.addBreakpoints(modelUri, [{ lineNumber: position.lineNumber, column: position.column > 1 ? position.column : undefined }], 'debugCommands.inlineBreakpointCommand');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return undefined;
|
||||
};
|
||||
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
||||
weight: KeybindingWeight.WorkbenchContrib,
|
||||
primary: KeyMod.Shift | KeyCode.F9,
|
||||
|
||||
@@ -180,7 +180,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
|
||||
return;
|
||||
}
|
||||
|
||||
const data = new Map<string, IBreakpointUpdateData>();
|
||||
const data: { [id: string]: IBreakpointUpdateData } = Object.create(null);
|
||||
const breakpoints = this.debugService.getModel().getBreakpoints();
|
||||
const modelUri = modelData.model.uri;
|
||||
for (let i = 0, len = modelData.breakpointDecorations.length; i < len; i++) {
|
||||
@@ -191,10 +191,10 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
|
||||
const breakpoint = breakpoints.filter(bp => bp.getId() === breakpointDecoration.modelId).pop();
|
||||
// since we know it is collapsed, it cannot grow to multiple lines
|
||||
if (breakpoint) {
|
||||
data.set(breakpoint.getId(), {
|
||||
data[breakpoint.getId()] = {
|
||||
lineNumber: decorationRange.startLineNumber,
|
||||
column: breakpoint.column ? decorationRange.startColumn : undefined,
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import { IContentWidget, ICodeEditor, IContentWidgetPosition, ContentWidgetPosit
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IDebugService, IExpression, IExpressionContainer } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { Expression } from 'vs/workbench/contrib/debug/common/debugModel';
|
||||
import { renderExpressionValue, replaceWhitespace } from 'vs/workbench/contrib/debug/browser/baseDebugView';
|
||||
import { renderExpressionValue } from 'vs/workbench/contrib/debug/browser/baseDebugView';
|
||||
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import { attachStylerCallback } from 'vs/platform/theme/common/styler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
@@ -237,7 +237,7 @@ export class DebugHoverWidget implements IContentWidget {
|
||||
this.complexValueContainer.hidden = false;
|
||||
|
||||
return this.tree.setInput(expression).then(() => {
|
||||
this.complexValueTitle.textContent = replaceWhitespace(expression.value);
|
||||
this.complexValueTitle.textContent = expression.value;
|
||||
this.complexValueTitle.title = expression.value;
|
||||
this.layoutTreeAndContainer();
|
||||
this.editor.layoutContentWidget(this);
|
||||
|
||||
@@ -4,81 +4,100 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||
import { IDebugService, State, IDebugConfiguration } from 'vs/workbench/contrib/debug/common/debug';
|
||||
import { Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IStatusbarEntry, IStatusbarService, StatusbarAlignment, IStatusbarEntryAccessor } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { STATUS_BAR_DEBUGGING_FOREGROUND, isStatusbarInDebugMode } from 'vs/workbench/contrib/debug/browser/statusbarColorProvider';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
export class DebugStatusContribution implements IWorkbenchContribution {
|
||||
|
||||
export class DebugStatus extends Themable implements IStatusbarItem {
|
||||
private container: HTMLElement;
|
||||
private statusBarItem: HTMLElement;
|
||||
private label: HTMLElement;
|
||||
private icon: HTMLElement;
|
||||
private showInStatusBar: 'never' | 'always' | 'onFirstSessionStart';
|
||||
private toDispose: IDisposable[] = [];
|
||||
private entryAccessor: IStatusbarEntryAccessor | undefined;
|
||||
|
||||
constructor(
|
||||
@IStatusbarService private readonly statusBarService: IStatusbarService,
|
||||
@IDebugService readonly debugService: IDebugService,
|
||||
@IConfigurationService readonly configurationService: IConfigurationService
|
||||
@IQuickOpenService private readonly quickOpenService: IQuickOpenService,
|
||||
@IDebugService private readonly debugService: IDebugService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IConfigurationService configurationService: IConfigurationService
|
||||
) {
|
||||
|
||||
const addStatusBarEntry = () => {
|
||||
this.entryAccessor = this.statusBarService.addEntry(this.entry, 'status.debug', nls.localize('status.debug', "Debug"), StatusbarAlignment.LEFT, 30 /* Low Priority */);
|
||||
};
|
||||
|
||||
const setShowInStatusBar = () => {
|
||||
this.showInStatusBar = configurationService.getValue<IDebugConfiguration>('debug').showInStatusBar;
|
||||
if (this.showInStatusBar === 'always' && !this.entryAccessor) {
|
||||
addStatusBarEntry();
|
||||
}
|
||||
};
|
||||
setShowInStatusBar();
|
||||
|
||||
this.toDispose.push(this.debugService.onDidChangeState(state => {
|
||||
if (state !== State.Inactive && this.showInStatusBar === 'onFirstSessionStart' && !this.entryAccessor) {
|
||||
addStatusBarEntry();
|
||||
}
|
||||
super(themeService);
|
||||
this._register(this.debugService.getConfigurationManager().onDidSelectConfiguration(e => {
|
||||
this.setLabel();
|
||||
}));
|
||||
this.toDispose.push(configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration('debug.showInStatusBar')) {
|
||||
setShowInStatusBar();
|
||||
if (this.entryAccessor && this.showInStatusBar === 'never') {
|
||||
this.entryAccessor.dispose();
|
||||
this.entryAccessor = undefined;
|
||||
this._register(this.debugService.onDidChangeState(state => {
|
||||
if (state !== State.Inactive && this.showInStatusBar === 'onFirstSessionStart') {
|
||||
this.doRender();
|
||||
} else {
|
||||
if (this.showInStatusBar !== 'never') {
|
||||
this.updateStyles();
|
||||
}
|
||||
}
|
||||
}));
|
||||
this.toDispose.push(this.debugService.getConfigurationManager().onDidSelectConfiguration(e => {
|
||||
if (this.entryAccessor) {
|
||||
this.entryAccessor.update(this.entry);
|
||||
this.showInStatusBar = configurationService.getValue<IDebugConfiguration>('debug').showInStatusBar;
|
||||
this._register(configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectsConfiguration('debug.showInStatusBar')) {
|
||||
this.showInStatusBar = configurationService.getValue<IDebugConfiguration>('debug').showInStatusBar;
|
||||
if (this.showInStatusBar === 'always') {
|
||||
this.doRender();
|
||||
}
|
||||
if (this.statusBarItem) {
|
||||
dom.toggleClass(this.statusBarItem, 'hidden', this.showInStatusBar === 'never');
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
private getText(): string {
|
||||
const manager = this.debugService.getConfigurationManager();
|
||||
const name = manager.selectedConfiguration.name || '';
|
||||
const nameAndLaunchPresent = name && manager.selectedConfiguration.launch;
|
||||
if (nameAndLaunchPresent) {
|
||||
return '$(play) ' + (manager.getLaunches().length > 1 ? `${name} (${manager.selectedConfiguration.launch!.name})` : name);
|
||||
protected updateStyles(): void {
|
||||
if (this.icon) {
|
||||
if (isStatusbarInDebugMode(this.debugService)) {
|
||||
this.icon.style.backgroundColor = this.getColor(STATUS_BAR_DEBUGGING_FOREGROUND);
|
||||
} else {
|
||||
this.icon.style.backgroundColor = this.getColor(STATUS_BAR_FOREGROUND);
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
private get entry(): IStatusbarEntry {
|
||||
return {
|
||||
text: this.getText(),
|
||||
tooltip: nls.localize('selectAndStartDebug', "Select and start debug configuration"),
|
||||
command: 'workbench.action.debug.selectandstart'
|
||||
};
|
||||
public render(container: HTMLElement): IDisposable {
|
||||
this.container = container;
|
||||
if (this.showInStatusBar === 'always') {
|
||||
this.doRender();
|
||||
}
|
||||
// noop, we render when we decide is best
|
||||
return this;
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
if (this.entryAccessor) {
|
||||
this.entryAccessor.dispose();
|
||||
private doRender(): void {
|
||||
if (!this.statusBarItem && this.container) {
|
||||
this.statusBarItem = dom.append(this.container, $('.debug-statusbar-item'));
|
||||
this._register(dom.addDisposableListener(this.statusBarItem, 'click', () => this.quickOpenService.show('debug ')));
|
||||
this.statusBarItem.title = nls.localize('selectAndStartDebug', "Select and start debug configuration");
|
||||
const a = dom.append(this.statusBarItem, $('a'));
|
||||
this.icon = dom.append(a, $('.icon'));
|
||||
this.label = dom.append(a, $('span.label'));
|
||||
this.setLabel();
|
||||
}
|
||||
|
||||
this.updateStyles();
|
||||
}
|
||||
|
||||
private setLabel(): void {
|
||||
if (this.label && this.statusBarItem) {
|
||||
const manager = this.debugService.getConfigurationManager();
|
||||
const name = manager.selectedConfiguration.name || '';
|
||||
const nameAndLaunchPresent = name && manager.selectedConfiguration.launch;
|
||||
dom.toggleClass(this.statusBarItem, 'hidden', this.showInStatusBar === 'never' || !nameAndLaunchPresent);
|
||||
if (nameAndLaunchPresent) {
|
||||
this.label.textContent = manager.getLaunches().length > 1 ? `${name} (${manager.selectedConfiguration.launch!.name})` : name;
|
||||
}
|
||||
}
|
||||
dispose(this.toDispose);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ export class DebugToolBar extends Themable implements IWorkbenchContribution {
|
||||
|
||||
const actionBarContainer = dom.append(this.$el, dom.$('div.action-bar-container'));
|
||||
this.debugToolBarMenu = menuService.createMenu(MenuId.DebugToolBar, contextKeyService);
|
||||
this._register(this.debugToolBarMenu);
|
||||
this.toDispose.push(this.debugToolBarMenu);
|
||||
|
||||
this.activeActions = [];
|
||||
this.actionBar = this._register(new ActionBar(actionBarContainer, {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { StartAction, ConfigureAction, SelectAndStartAction, FocusSessionAction
|
||||
import { StartDebugActionViewItem, FocusSessionActionViewItem } from 'vs/workbench/contrib/debug/browser/debugActionViewItems';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { IProgressService } from 'vs/platform/progress/common/progress';
|
||||
import { IProgressService, IProgressRunner } from 'vs/platform/progress/common/progress';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
@@ -37,7 +37,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
export class DebugViewlet extends ViewContainerViewlet {
|
||||
|
||||
private startDebugActionViewItem: StartDebugActionViewItem;
|
||||
private progressResolve: (() => void) | undefined;
|
||||
private progressRunner: IProgressRunner;
|
||||
private breakpointView: ViewletPanel;
|
||||
private panelListeners = new Map<string, IDisposable>();
|
||||
private debugToolBarMenu: IMenu;
|
||||
@@ -112,7 +112,7 @@ export class DebugViewlet extends ViewContainerViewlet {
|
||||
|
||||
if (!this.debugToolBarMenu) {
|
||||
this.debugToolBarMenu = this.menuService.createMenu(MenuId.DebugToolBar, this.contextKeyService);
|
||||
this._register(this.debugToolBarMenu);
|
||||
this.toDispose.push(this.debugToolBarMenu);
|
||||
}
|
||||
return DebugToolBar.getActions(this.debugToolBarMenu, this.debugService, this.instantiationService);
|
||||
}
|
||||
@@ -153,15 +153,12 @@ export class DebugViewlet extends ViewContainerViewlet {
|
||||
}
|
||||
|
||||
private onDebugServiceStateChange(state: State): void {
|
||||
if (this.progressResolve) {
|
||||
this.progressResolve();
|
||||
this.progressResolve = undefined;
|
||||
if (this.progressRunner) {
|
||||
this.progressRunner.done();
|
||||
}
|
||||
|
||||
if (state === State.Initializing) {
|
||||
this.progressService.withProgress({ location: VIEWLET_ID }, _progress => {
|
||||
return new Promise(resolve => this.progressResolve = resolve);
|
||||
});
|
||||
this.progressRunner = this.progressService.show(true);
|
||||
}
|
||||
|
||||
this.updateToolBar();
|
||||
|
||||
@@ -35,12 +35,12 @@ export class ExceptionWidget extends ZoneWidget {
|
||||
this._backgroundColor = Color.white;
|
||||
|
||||
this._applyTheme(themeService.getTheme());
|
||||
this._disposables.add(themeService.onThemeChange(this._applyTheme.bind(this)));
|
||||
this._disposables.push(themeService.onThemeChange(this._applyTheme.bind(this)));
|
||||
|
||||
this.create();
|
||||
const onDidLayoutChangeScheduler = new RunOnceScheduler(() => this._doLayout(undefined, undefined), 50);
|
||||
this._disposables.add(this.editor.onDidLayoutChange(() => onDidLayoutChangeScheduler.schedule()));
|
||||
this._disposables.add(onDidLayoutChangeScheduler);
|
||||
this._disposables.push(this.editor.onDidLayoutChange(() => onDidLayoutChangeScheduler.schedule()));
|
||||
this._disposables.push(onDidLayoutChangeScheduler);
|
||||
}
|
||||
|
||||
private _applyTheme(theme: ITheme): void {
|
||||
|
||||
@@ -19,7 +19,7 @@ export class LinkDetector {
|
||||
// group 2: drive letter on windows with trailing backslash or leading slash on mac/linux
|
||||
// group 3: line number, matched by (:(\d+))
|
||||
// group 4: column number, matched by ((?::(\d+))?)
|
||||
// e.g.: at Context.<anonymous> (c:\Users\someone\Desktop\mocha-runner\test\test.js:26:11)
|
||||
// eg: at Context.<anonymous> (c:\Users\someone\Desktop\mocha-runner\test\test.js:26:11)
|
||||
/(?![\(])(?:file:\/\/)?((?:([a-zA-Z]+:)|[^\(\)<>\'\"\[\]:\s]+)(?:[\\/][^\(\)<>\'\"\[\]:]*)?\.[a-zA-Z]+[0-9]*):(\d+)(?::(\d+))?/g
|
||||
];
|
||||
|
||||
|
||||
@@ -45,15 +45,16 @@ type LoadedScriptsItem = BaseTreeItem;
|
||||
class BaseTreeItem {
|
||||
|
||||
private _showedMoreThanOne: boolean;
|
||||
private _children = new Map<string, BaseTreeItem>();
|
||||
private _children: { [key: string]: BaseTreeItem; };
|
||||
private _source: Source;
|
||||
|
||||
constructor(private _parent: BaseTreeItem | undefined, private _label: string) {
|
||||
this._children = {};
|
||||
this._showedMoreThanOne = false;
|
||||
}
|
||||
|
||||
isLeaf(): boolean {
|
||||
return this._children.size === 0;
|
||||
return Object.keys(this._children).length === 0;
|
||||
}
|
||||
|
||||
getSession(): IDebugSession | undefined {
|
||||
@@ -65,12 +66,12 @@ class BaseTreeItem {
|
||||
|
||||
setSource(session: IDebugSession, source: Source): void {
|
||||
this._source = source;
|
||||
this._children.clear();
|
||||
this._children = {};
|
||||
if (source.raw && source.raw.sources) {
|
||||
for (const src of source.raw.sources) {
|
||||
if (src.name && src.path) {
|
||||
const s = new BaseTreeItem(this, src.name);
|
||||
this._children.set(src.path, s);
|
||||
this._children[src.path] = s;
|
||||
const ss = session.getSource(src);
|
||||
s.setSource(session, ss);
|
||||
}
|
||||
@@ -79,26 +80,26 @@ class BaseTreeItem {
|
||||
}
|
||||
|
||||
createIfNeeded<T extends BaseTreeItem>(key: string, factory: (parent: BaseTreeItem, label: string) => T): T {
|
||||
let child = <T>this._children.get(key);
|
||||
let child = <T>this._children[key];
|
||||
if (!child) {
|
||||
child = factory(this, key);
|
||||
this._children.set(key, child);
|
||||
this._children[key] = child;
|
||||
}
|
||||
return child;
|
||||
}
|
||||
|
||||
getChild(key: string): BaseTreeItem | undefined {
|
||||
return this._children.get(key);
|
||||
getChild(key: string): BaseTreeItem {
|
||||
return this._children[key];
|
||||
}
|
||||
|
||||
remove(key: string): void {
|
||||
this._children.delete(key);
|
||||
delete this._children[key];
|
||||
}
|
||||
|
||||
removeFromParent(): void {
|
||||
if (this._parent) {
|
||||
this._parent.remove(this._label);
|
||||
if (this._parent._children.size === 0) {
|
||||
if (Object.keys(this._parent._children).length === 0) {
|
||||
this._parent.removeFromParent();
|
||||
}
|
||||
}
|
||||
@@ -141,7 +142,7 @@ class BaseTreeItem {
|
||||
if (child) {
|
||||
return child.hasChildren();
|
||||
}
|
||||
return this._children.size > 0;
|
||||
return Object.keys(this._children).length > 0;
|
||||
}
|
||||
|
||||
// skips intermediate single-child nodes
|
||||
@@ -150,10 +151,7 @@ class BaseTreeItem {
|
||||
if (child) {
|
||||
return child.getChildren();
|
||||
}
|
||||
const array: BaseTreeItem[] = [];
|
||||
for (let child of this._children.values()) {
|
||||
array.push(child);
|
||||
}
|
||||
const array = Object.keys(this._children).map(key => this._children[key]);
|
||||
return Promise.resolve(array.sort((a, b) => this.compare(a, b)));
|
||||
}
|
||||
|
||||
@@ -201,11 +199,12 @@ class BaseTreeItem {
|
||||
|
||||
private oneChild(): BaseTreeItem | undefined {
|
||||
if (SMART && !this._source && !this._showedMoreThanOne && !(this instanceof RootFolderTreeItem) && !(this instanceof SessionTreeItem)) {
|
||||
if (this._children.size === 1) {
|
||||
return this._children.values().next().value;
|
||||
const keys = Object.keys(this._children);
|
||||
if (keys.length === 1) {
|
||||
return this._children[keys[0]];
|
||||
}
|
||||
// if a node had more than one child once, it will never be skipped again
|
||||
if (this._children.size > 1) {
|
||||
if (keys.length > 1) {
|
||||
this._showedMoreThanOne = true;
|
||||
}
|
||||
}
|
||||
@@ -244,7 +243,7 @@ class SessionTreeItem extends BaseTreeItem {
|
||||
|
||||
private _session: IDebugSession;
|
||||
private _initialized: boolean;
|
||||
private _map = new Map<string, BaseTreeItem>();
|
||||
private _map: Map<string, BaseTreeItem>;
|
||||
private _labelService: ILabelService;
|
||||
|
||||
constructor(labelService: ILabelService, parent: BaseTreeItem, session: IDebugSession, private _environmentService: IEnvironmentService, private rootProvider: IWorkspaceContextService) {
|
||||
@@ -252,6 +251,7 @@ class SessionTreeItem extends BaseTreeItem {
|
||||
this._labelService = labelService;
|
||||
this._initialized = false;
|
||||
this._session = session;
|
||||
this._map = new Map();
|
||||
}
|
||||
|
||||
getSession(): IDebugSession {
|
||||
@@ -417,7 +417,7 @@ export class LoadedScriptsView extends ViewletPanel {
|
||||
const root = new RootTreeItem(this.debugService.getModel(), this.environmentService, this.contextService, this.labelService);
|
||||
|
||||
this.treeLabels = this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this.onDidChangeBodyVisibility });
|
||||
this._register(this.treeLabels);
|
||||
this.disposables.push(this.treeLabels);
|
||||
|
||||
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, this.treeContainer, new LoadedScriptsDelegate(),
|
||||
[new LoadedScriptsRenderer(this.treeLabels)],
|
||||
@@ -443,11 +443,11 @@ export class LoadedScriptsView extends ViewletPanel {
|
||||
this.tree.updateChildren();
|
||||
}
|
||||
}, 300);
|
||||
this._register(this.changeScheduler);
|
||||
this.disposables.push(this.changeScheduler);
|
||||
|
||||
const loadedScriptsNavigator = new TreeResourceNavigator2(this.tree);
|
||||
this._register(loadedScriptsNavigator);
|
||||
this._register(loadedScriptsNavigator.onDidOpenResource(e => {
|
||||
this.disposables.push(loadedScriptsNavigator);
|
||||
this.disposables.push(loadedScriptsNavigator.onDidOpenResource(e => {
|
||||
if (e.element instanceof BaseTreeItem) {
|
||||
const source = e.element.getSource();
|
||||
if (source && source.available) {
|
||||
@@ -457,7 +457,7 @@ export class LoadedScriptsView extends ViewletPanel {
|
||||
}
|
||||
}));
|
||||
|
||||
this._register(this.tree.onDidChangeFocus(() => {
|
||||
this.disposables.push(this.tree.onDidChangeFocus(() => {
|
||||
const focus = this.tree.getFocus();
|
||||
if (focus instanceof SessionTreeItem) {
|
||||
this.loadedScriptsItemType.set('session');
|
||||
@@ -467,7 +467,7 @@ export class LoadedScriptsView extends ViewletPanel {
|
||||
}));
|
||||
|
||||
const registerLoadedSourceListener = (session: IDebugSession) => {
|
||||
this._register(session.onDidLoadedSource(event => {
|
||||
this.disposables.push(session.onDidLoadedSource(event => {
|
||||
let sessionRoot: SessionTreeItem;
|
||||
switch (event.reason) {
|
||||
case 'new':
|
||||
@@ -501,17 +501,17 @@ export class LoadedScriptsView extends ViewletPanel {
|
||||
}));
|
||||
};
|
||||
|
||||
this._register(this.debugService.onDidNewSession(registerLoadedSourceListener));
|
||||
this.disposables.push(this.debugService.onDidNewSession(registerLoadedSourceListener));
|
||||
this.debugService.getModel().getSessions().forEach(registerLoadedSourceListener);
|
||||
|
||||
this._register(this.debugService.onDidEndSession(session => {
|
||||
this.disposables.push(this.debugService.onDidEndSession(session => {
|
||||
root.remove(session.getId());
|
||||
this.changeScheduler.schedule();
|
||||
}));
|
||||
|
||||
this.changeScheduler.schedule(0);
|
||||
|
||||
this._register(this.onDidChangeBodyVisibility(visible => {
|
||||
this.disposables.push(this.onDidChangeBodyVisibility(visible => {
|
||||
if (visible && this.treeNeedsRefreshOnVisible) {
|
||||
this.changeScheduler.schedule();
|
||||
}
|
||||
|
||||
@@ -18,5 +18,6 @@
|
||||
|
||||
.monaco-editor .zone-widget .zone-widget-container.breakpoint-widget .inputContainer {
|
||||
flex: 1;
|
||||
margin-top: 8px;
|
||||
margin-top: 6px;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
@@ -110,6 +110,25 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* Debug status */
|
||||
/* A very precise css rule to overwrite the display set in statusbar.css */
|
||||
.monaco-workbench .part.statusbar > .statusbar-item > .debug-statusbar-item > a {
|
||||
display: flex;
|
||||
padding: 0 5px 0 5px;
|
||||
}
|
||||
|
||||
.monaco-workbench .part.statusbar .debug-statusbar-item.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.monaco-workbench .part.statusbar .debug-statusbar-item .icon {
|
||||
-webkit-mask: url('start.svg') no-repeat 50% 50%;
|
||||
-webkit-mask-size: 16px;
|
||||
display: inline-block;
|
||||
padding-right: 2px;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
.monaco-workbench .debug-view-content .monaco-list-row .monaco-tl-contents {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -123,7 +142,6 @@
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-family: var(--monaco-monospace-font);
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.monaco-workbench.mac .debug-viewlet .monaco-list-row .expression,
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
text-overflow: ellipsis;
|
||||
height: 18px;
|
||||
overflow: hidden;
|
||||
white-space: pre;
|
||||
border-bottom: 1px solid rgba(128, 128, 128, 0.35);
|
||||
}
|
||||
|
||||
@@ -61,6 +60,10 @@
|
||||
max-height: 500px;
|
||||
}
|
||||
|
||||
.monaco-editor .debug-hover-widget .monaco-tl-contents .value {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.monaco-editor .debug-hover-widget .error {
|
||||
color: #E51400;
|
||||
}
|
||||
|
||||
@@ -246,6 +246,10 @@
|
||||
opacity: 0.35;
|
||||
}
|
||||
|
||||
.monaco-workbench .debug-viewlet .monaco-list-row .expression {
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.debug-viewlet .debug-call-stack .error {
|
||||
font-style: italic;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@@ -127,6 +127,61 @@
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-italic { font-style: italic; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-underline { text-decoration: underline; }
|
||||
|
||||
/* Regular and bright color codes are currently treated the same. */
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-foreground-30, .monaco-workbench .repl .repl-tree .output.expression .code-foreground-90 { color: gray; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-foreground-31, .monaco-workbench .repl .repl-tree .output.expression .code-foreground-91 { color: #BE1717; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-foreground-32, .monaco-workbench .repl .repl-tree .output.expression .code-foreground-92 { color: #338A2F; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-foreground-33, .monaco-workbench .repl .repl-tree .output.expression .code-foreground-93 { color: #BEB817; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-foreground-34, .monaco-workbench .repl .repl-tree .output.expression .code-foreground-94 { color: darkblue; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-foreground-35, .monaco-workbench .repl .repl-tree .output.expression .code-foreground-95 { color: darkmagenta; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-foreground-36, .monaco-workbench .repl .repl-tree .output.expression .code-foreground-96 { color: darkcyan; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-foreground-37, .monaco-workbench .repl .repl-tree .output.expression .code-foreground-97 { color: #BDBDBD; }
|
||||
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-background-40, .monaco-workbench .repl .repl-tree .output.expression .code-background-100 { background-color: gray; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-background-41, .monaco-workbench .repl .repl-tree .output.expression .code-background-101 { background-color: #BE1717; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-background-42, .monaco-workbench .repl .repl-tree .output.expression .code-background-102 { background-color: #338A2F; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-background-43, .monaco-workbench .repl .repl-tree .output.expression .code-background-103 { background-color: #BEB817; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-background-44, .monaco-workbench .repl .repl-tree .output.expression .code-background-104 { background-color: darkblue; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-background-45, .monaco-workbench .repl .repl-tree .output.expression .code-background-105 { background-color: darkmagenta; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-background-46, .monaco-workbench .repl .repl-tree .output.expression .code-background-106 { background-color: darkcyan; }
|
||||
.monaco-workbench .repl .repl-tree .output.expression .code-background-47, .monaco-workbench .repl .repl-tree .output.expression .code-background-107 { background-color: #BDBDBD; }
|
||||
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-30, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-90 { color: #A0A0A0; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-31, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-91 { color: #A74747; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-32, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-92 { color: #348F34; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-33, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-93 { color: #5F4C29; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-34, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-94 { color: #6286BB; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-35, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-95 { color: #914191; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-36, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-96 { color: #218D8D; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-37, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-foreground-97 { color: #707070; }
|
||||
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-40, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-100 { background-color: #A0A0A0; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-41, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-101 { background-color: #A74747; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-42, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-102 { background-color: #348F34; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-43, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-103 { background-color: #5F4C29; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-44, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-104 { background-color: #6286BB; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-45, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-105 { background-color: #914191; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-46, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-106 { background-color: #218D8D; }
|
||||
.vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-47, .vs-dark .monaco-workbench .repl .repl-tree .output.expression .code-background-107 { background-color: #707070; }
|
||||
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-30, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-90 { color: gray; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-31, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-91 { color: #A74747; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-32, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-92 { color: #348F34; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-33, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-93 { color: #5F4C29; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-34, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-94 { color: #6286BB; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-35, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-95 { color: #914191; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-36, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-96 { color: #218D8D; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-37, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-foreground-97 { color: #707070; }
|
||||
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-40, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-100 { background-color: gray; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-41, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-101 { background-color: #A74747; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-42, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-102 { background-color: #348F34; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-43, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-103 { background-color: #5F4C29; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-44, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-104 { background-color: #6286BB; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-45, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-105 { background-color: #914191; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-46, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-106 { background-color: #218D8D; }
|
||||
.hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-47, .hc-black .monaco-workbench .repl .repl-tree .output.expression .code-background-107 { background-color: #707070; }
|
||||
|
||||
/* Links */
|
||||
.monaco-workbench .repl .repl-tree .output.expression a {
|
||||
text-decoration: underline;
|
||||
|
||||
@@ -11,7 +11,7 @@ import { IAction, IActionViewItem, Action } from 'vs/base/common/actions';
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import * as aria from 'vs/base/browser/ui/aria/aria';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import severity from 'vs/base/common/severity';
|
||||
import { SuggestController } from 'vs/editor/contrib/suggest/suggestController';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
@@ -76,7 +76,6 @@ interface IPrivateReplService {
|
||||
getVisibleContent(): string;
|
||||
selectSession(session?: IDebugSession): void;
|
||||
clearRepl(): void;
|
||||
focusRepl(): void;
|
||||
}
|
||||
|
||||
function revealLastElement(tree: WorkbenchAsyncDataTree<any, any, any>) {
|
||||
@@ -134,16 +133,15 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
|
||||
}
|
||||
this.selectSession();
|
||||
}));
|
||||
this._register(this.debugService.onWillNewSession(newSession => {
|
||||
this._register(this.debugService.onWillNewSession(() => {
|
||||
// Need to listen to output events for sessions which are not yet fully initialised
|
||||
const input = this.tree.getInput();
|
||||
if (!input || input.state === State.Inactive) {
|
||||
this.selectSession(newSession);
|
||||
this.selectSession();
|
||||
}
|
||||
this.updateTitleArea();
|
||||
}));
|
||||
this._register(this.themeService.onThemeChange(() => {
|
||||
this.refreshReplElements(false);
|
||||
if (this.isVisible()) {
|
||||
this.updateInputDecoration();
|
||||
}
|
||||
@@ -183,10 +181,6 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
|
||||
this.navigateHistory(false);
|
||||
}
|
||||
|
||||
focusRepl(): void {
|
||||
this.tree.domFocus();
|
||||
}
|
||||
|
||||
private onDidFontChange(): void {
|
||||
if (this.styleElement) {
|
||||
const debugConsole = this.configurationService.getValue<IDebugConfiguration>('debug').console;
|
||||
@@ -288,7 +282,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
|
||||
const lineDelimiter = this.textResourcePropertiesService.getEOL(this.model.uri);
|
||||
const traverseAndAppend = (node: ITreeNode<IReplElement, FuzzyScore>) => {
|
||||
node.children.forEach(child => {
|
||||
text += child.element.toString().trimRight() + lineDelimiter;
|
||||
text += child.element.toString() + lineDelimiter;
|
||||
if (!child.collapsed && child.children.length) {
|
||||
traverseAndAppend(child);
|
||||
}
|
||||
@@ -387,16 +381,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
|
||||
supportDynamicHeights: true
|
||||
}) as WorkbenchAsyncDataTree<IDebugSession, IReplElement, FuzzyScore>;
|
||||
|
||||
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
||||
let lastSelectedString: string;
|
||||
this._register(this.tree.onMouseClick(() => {
|
||||
const selection = window.getSelection();
|
||||
if (!selection || selection.type !== 'Range' || lastSelectedString === selection.toString()) {
|
||||
// only focus the input if the user is not currently selecting.
|
||||
this.replInput.focus();
|
||||
}
|
||||
lastSelectedString = selection ? selection.toString() : '';
|
||||
}));
|
||||
this.toDispose.push(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
||||
// Make sure to select the session if debugging is already active
|
||||
this.selectSession();
|
||||
this.styleElement = dom.createStyleSheet(this.container);
|
||||
@@ -621,8 +606,7 @@ class ReplSimpleElementsRenderer implements ITreeRenderer<SimpleReplElement, Fuz
|
||||
constructor(
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@ILabelService private readonly labelService: ILabelService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IThemeService private readonly themeService: IThemeService
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService
|
||||
) { }
|
||||
|
||||
get templateId(): string {
|
||||
@@ -665,7 +649,7 @@ class ReplSimpleElementsRenderer implements ITreeRenderer<SimpleReplElement, Fuz
|
||||
dom.clearNode(templateData.value);
|
||||
// Reset classes to clear ansi decorations since templates are reused
|
||||
templateData.value.className = 'value';
|
||||
const result = handleANSIOutput(element.value, this.linkDetector, this.themeService);
|
||||
const result = handleANSIOutput(element.value, this.linkDetector);
|
||||
templateData.value.appendChild(result);
|
||||
|
||||
dom.addClass(templateData.value, (element.severity === severity.Warning) ? 'warn' : (element.severity === severity.Error) ? 'error' : (element.severity === severity.Ignore) ? 'ignore' : 'info');
|
||||
@@ -848,28 +832,6 @@ class AcceptReplInputAction extends EditorAction {
|
||||
}
|
||||
}
|
||||
|
||||
class FilterReplAction extends EditorAction {
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
id: 'repl.action.filter',
|
||||
label: nls.localize('repl.action.filter', "REPL Focus Content to Filter"),
|
||||
alias: 'REPL Filter',
|
||||
precondition: CONTEXT_IN_DEBUG_REPL,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_F,
|
||||
weight: KeybindingWeight.EditorContrib
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
run(accessor: ServicesAccessor, editor: ICodeEditor): void | Promise<void> {
|
||||
SuggestController.get(editor).acceptSelectedSuggestion();
|
||||
accessor.get(IPrivateReplService).focusRepl();
|
||||
}
|
||||
}
|
||||
|
||||
class ReplCopyAllAction extends EditorAction {
|
||||
|
||||
constructor() {
|
||||
@@ -889,7 +851,6 @@ class ReplCopyAllAction extends EditorAction {
|
||||
|
||||
registerEditorAction(AcceptReplInputAction);
|
||||
registerEditorAction(ReplCopyAllAction);
|
||||
registerEditorAction(FilterReplAction);
|
||||
|
||||
class SelectReplActionViewItem extends FocusSessionActionViewItem {
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri
|
||||
this.styleElement = createStyleSheet(container);
|
||||
}
|
||||
|
||||
this.styleElement.innerHTML = `.monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-beak:before { border-bottom-color: ${backgroundColor} !important; }`;
|
||||
this.styleElement.innerHTML = `.monaco-workbench .part.statusbar > .statusbar-item.has-beak:before { border-bottom-color: ${backgroundColor} !important; }`;
|
||||
}
|
||||
|
||||
private getColorKey(noFolderColor: string, debuggingColor: string, normalColor: string): string {
|
||||
@@ -115,6 +115,6 @@ export function isStatusbarInDebugMode(debugService: IDebugService): boolean {
|
||||
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
const statusBarItemDebuggingForeground = theme.getColor(STATUS_BAR_DEBUGGING_FOREGROUND);
|
||||
if (statusBarItemDebuggingForeground) {
|
||||
collector.addRule(`.monaco-workbench .part.statusbar.debugging > .items-container > .statusbar-item .mask-icon { background-color: ${statusBarItemDebuggingForeground} !important; }`);
|
||||
collector.addRule(`.monaco-workbench .part.statusbar.debugging > .statusbar-item .mask-icon { background-color: ${statusBarItemDebuggingForeground} !important; }`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -88,7 +88,7 @@ export class VariablesView extends ViewletPanel {
|
||||
this.toolbar.setActions([collapseAction])();
|
||||
this.tree.updateChildren();
|
||||
|
||||
this._register(this.debugService.getViewModel().onDidFocusStackFrame(sf => {
|
||||
this.disposables.push(this.debugService.getViewModel().onDidFocusStackFrame(sf => {
|
||||
if (!this.isBodyVisible()) {
|
||||
this.needsRefresh = true;
|
||||
return;
|
||||
@@ -99,16 +99,16 @@ export class VariablesView extends ViewletPanel {
|
||||
const timeout = sf.explicit ? 0 : undefined;
|
||||
this.onFocusStackFrameScheduler.schedule(timeout);
|
||||
}));
|
||||
this._register(variableSetEmitter.event(() => this.tree.updateChildren()));
|
||||
this._register(this.tree.onMouseDblClick(e => this.onMouseDblClick(e)));
|
||||
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
||||
this.disposables.push(variableSetEmitter.event(() => this.tree.updateChildren()));
|
||||
this.disposables.push(this.tree.onMouseDblClick(e => this.onMouseDblClick(e)));
|
||||
this.disposables.push(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
||||
|
||||
this._register(this.onDidChangeBodyVisibility(visible => {
|
||||
this.disposables.push(this.onDidChangeBodyVisibility(visible => {
|
||||
if (visible && this.needsRefresh) {
|
||||
this.onFocusStackFrameScheduler.schedule();
|
||||
}
|
||||
}));
|
||||
this._register(this.debugService.getViewModel().onDidSelectExpression(e => {
|
||||
this.disposables.push(this.debugService.getViewModel().onDidSelectExpression(e => {
|
||||
if (e instanceof Variable) {
|
||||
this.tree.rerender(e);
|
||||
}
|
||||
|
||||
@@ -76,16 +76,16 @@ export class WatchExpressionsView extends ViewletPanel {
|
||||
const removeAllWatchExpressionsAction = new RemoveAllWatchExpressionsAction(RemoveAllWatchExpressionsAction.ID, RemoveAllWatchExpressionsAction.LABEL, this.debugService, this.keybindingService);
|
||||
this.toolbar.setActions([addWatchExpressionAction, collapseAction, removeAllWatchExpressionsAction])();
|
||||
|
||||
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
||||
this._register(this.tree.onMouseDblClick(e => this.onMouseDblClick(e)));
|
||||
this._register(this.debugService.getModel().onDidChangeWatchExpressions(we => {
|
||||
this.disposables.push(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
||||
this.disposables.push(this.tree.onMouseDblClick(e => this.onMouseDblClick(e)));
|
||||
this.disposables.push(this.debugService.getModel().onDidChangeWatchExpressions(we => {
|
||||
if (!this.isBodyVisible()) {
|
||||
this.needsRefresh = true;
|
||||
} else {
|
||||
this.tree.updateChildren();
|
||||
}
|
||||
}));
|
||||
this._register(this.debugService.getViewModel().onDidFocusStackFrame(() => {
|
||||
this.disposables.push(this.debugService.getViewModel().onDidFocusStackFrame(() => {
|
||||
if (!this.isBodyVisible()) {
|
||||
this.needsRefresh = true;
|
||||
return;
|
||||
@@ -95,14 +95,14 @@ export class WatchExpressionsView extends ViewletPanel {
|
||||
this.onWatchExpressionsUpdatedScheduler.schedule();
|
||||
}
|
||||
}));
|
||||
this._register(variableSetEmitter.event(() => this.tree.updateChildren()));
|
||||
this.disposables.push(variableSetEmitter.event(() => this.tree.updateChildren()));
|
||||
|
||||
this._register(this.onDidChangeBodyVisibility(visible => {
|
||||
this.disposables.push(this.onDidChangeBodyVisibility(visible => {
|
||||
if (visible && this.needsRefresh) {
|
||||
this.onWatchExpressionsUpdatedScheduler.schedule();
|
||||
}
|
||||
}));
|
||||
this._register(this.debugService.getViewModel().onDidSelectExpression(e => {
|
||||
this.disposables.push(this.debugService.getViewModel().onDidSelectExpression(e => {
|
||||
if (e instanceof Expression && e.name) {
|
||||
this.tree.rerender(e);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { IDebugAdapter } from 'vs/workbench/contrib/debug/common/debug';
|
||||
export abstract class AbstractDebugAdapter implements IDebugAdapter {
|
||||
|
||||
private sequence: number;
|
||||
private pendingRequests = new Map<number, (e: DebugProtocol.Response) => void>();
|
||||
private pendingRequests: Map<number, (e: DebugProtocol.Response) => void>;
|
||||
private requestCallback: (request: DebugProtocol.Request) => void;
|
||||
private eventCallback: (request: DebugProtocol.Event) => void;
|
||||
private messageCallback: (message: DebugProtocol.ProtocolMessage) => void;
|
||||
@@ -22,6 +22,7 @@ export abstract class AbstractDebugAdapter implements IDebugAdapter {
|
||||
|
||||
constructor() {
|
||||
this.sequence = 1;
|
||||
this.pendingRequests = new Map();
|
||||
this._onError = new Emitter<Error>();
|
||||
this._onExit = new Emitter<number>();
|
||||
}
|
||||
@@ -138,7 +139,7 @@ export abstract class AbstractDebugAdapter implements IDebugAdapter {
|
||||
|
||||
protected cancelPending() {
|
||||
const pending = this.pendingRequests;
|
||||
this.pendingRequests.clear();
|
||||
this.pendingRequests = new Map();
|
||||
setTimeout(_ => {
|
||||
pending.forEach((callback, request_seq) => {
|
||||
const err: DebugProtocol.Response = {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { IJSONSchemaSnippet } from 'vs/base/common/jsonSchema';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IEditorContribution } from 'vs/editor/common/editorCommon';
|
||||
import { ITextModel as EditorIModel } from 'vs/editor/common/model';
|
||||
import { IEditor, ITextEditor } from 'vs/workbench/common/editor';
|
||||
import { IEditor } from 'vs/workbench/common/editor';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { CompletionItem } from 'vs/editor/common/modes';
|
||||
import { Source } from 'vs/workbench/contrib/debug/common/debugSource';
|
||||
@@ -298,7 +298,7 @@ export interface IStackFrame extends ITreeElement {
|
||||
getSpecificSourceName(): string;
|
||||
restart(): Promise<any>;
|
||||
toString(): string;
|
||||
openInEditor(editorService: IEditorService, preserveFocus?: boolean, sideBySide?: boolean): Promise<ITextEditor | null>;
|
||||
openInEditor(editorService: IEditorService, preserveFocus?: boolean, sideBySide?: boolean): Promise<any>;
|
||||
}
|
||||
|
||||
export interface IEnablement extends ITreeElement {
|
||||
@@ -339,7 +339,6 @@ export interface IBreakpoint extends IBaseBreakpoint {
|
||||
readonly endColumn?: number;
|
||||
readonly message?: string;
|
||||
readonly adapterData: any;
|
||||
readonly sessionAgnosticData: { lineNumber: number, column: number | undefined };
|
||||
}
|
||||
|
||||
export interface IFunctionBreakpoint extends IBaseBreakpoint {
|
||||
@@ -718,7 +717,7 @@ export interface IDebugService {
|
||||
/**
|
||||
* Updates the breakpoints.
|
||||
*/
|
||||
updateBreakpoints(uri: uri, data: Map<string, IBreakpointUpdateData>, sendOnResourceSaved: boolean): void;
|
||||
updateBreakpoints(uri: uri, data: { [id: string]: IBreakpointUpdateData }, sendOnResourceSaved: boolean): void;
|
||||
|
||||
/**
|
||||
* Enables or disables all breakpoints. If breakpoint is passed only enables or disables the passed breakpoint.
|
||||
|
||||
@@ -23,7 +23,6 @@ import { commonSuffixLength } from 'vs/base/common/strings';
|
||||
import { posix } from 'vs/base/common/path';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { ITextEditor } from 'vs/workbench/common/editor';
|
||||
|
||||
export class SimpleReplElement implements IReplElement {
|
||||
constructor(
|
||||
@@ -90,7 +89,7 @@ export class RawObjectReplElement implements IExpression {
|
||||
|
||||
export class ExpressionContainer implements IExpressionContainer {
|
||||
|
||||
public static allValues = new Map<string, string>();
|
||||
public static allValues: Map<string, string> = new Map<string, string>();
|
||||
// Use chunks to support variable paging #9537
|
||||
private static readonly BASE_CHUNK_SIZE = 100;
|
||||
|
||||
@@ -303,7 +302,7 @@ export class Scope extends ExpressionContainer implements IScope {
|
||||
indexedVariables?: number,
|
||||
public range?: IRange
|
||||
) {
|
||||
super(stackFrame.thread.session, reference, `scope:${name}:${index}`, namedVariables, indexedVariables);
|
||||
super(stackFrame.thread.session, reference, `scope:${stackFrame.getId()}:${name}:${index}`, namedVariables, indexedVariables);
|
||||
}
|
||||
|
||||
toString(): string {
|
||||
@@ -388,7 +387,7 @@ export class StackFrame implements IStackFrame {
|
||||
return sourceToString === UNKNOWN_SOURCE_LABEL ? this.name : `${this.name} (${sourceToString})`;
|
||||
}
|
||||
|
||||
openInEditor(editorService: IEditorService, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): Promise<ITextEditor | null> {
|
||||
openInEditor(editorService: IEditorService, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): Promise<any> {
|
||||
return !this.source.available ? Promise.resolve(null) :
|
||||
this.source.openInEditor(editorService, this.range, preserveFocus, sideBySide, pinned);
|
||||
}
|
||||
@@ -660,13 +659,6 @@ export class Breakpoint extends BaseBreakpoint implements IBreakpoint {
|
||||
return data ? data.endColumn : undefined;
|
||||
}
|
||||
|
||||
get sessionAgnosticData(): { lineNumber: number, column: number | undefined } {
|
||||
return {
|
||||
lineNumber: this._lineNumber,
|
||||
column: this._column
|
||||
};
|
||||
}
|
||||
|
||||
setSessionData(sessionId: string, data: DebugProtocol.Breakpoint): void {
|
||||
super.setSessionData(sessionId, data);
|
||||
if (!this._adapterData) {
|
||||
@@ -962,10 +954,10 @@ export class DebugModel implements IDebugModel {
|
||||
this._onDidChangeBreakpoints.fire({ removed: toRemove });
|
||||
}
|
||||
|
||||
updateBreakpoints(data: Map<string, IBreakpointUpdateData>): void {
|
||||
updateBreakpoints(data: { [id: string]: IBreakpointUpdateData }): void {
|
||||
const updated: IBreakpoint[] = [];
|
||||
this.breakpoints.forEach(bp => {
|
||||
const bpData = data.get(bp.getId());
|
||||
const bpData = data[bp.getId()];
|
||||
if (bpData) {
|
||||
bp.update(bpData);
|
||||
updated.push(bp);
|
||||
@@ -975,15 +967,15 @@ export class DebugModel implements IDebugModel {
|
||||
this._onDidChangeBreakpoints.fire({ changed: updated });
|
||||
}
|
||||
|
||||
setBreakpointSessionData(sessionId: string, data: Map<string, DebugProtocol.Breakpoint>): void {
|
||||
setBreakpointSessionData(sessionId: string, data: { [id: string]: DebugProtocol.Breakpoint }): void {
|
||||
this.breakpoints.forEach(bp => {
|
||||
const bpData = data.get(bp.getId());
|
||||
const bpData = data[bp.getId()];
|
||||
if (bpData) {
|
||||
bp.setSessionData(sessionId, bpData);
|
||||
}
|
||||
});
|
||||
this.functionBreakpoints.forEach(fbp => {
|
||||
const fbpData = data.get(fbp.getId());
|
||||
const fbpData = data[fbp.getId()];
|
||||
if (fbpData) {
|
||||
fbp.setSessionData(sessionId, fbpData);
|
||||
}
|
||||
|
||||
@@ -240,8 +240,6 @@ declare module DebugProtocol {
|
||||
'attachForSuspendedLaunch': A project launcher component has launched a new process in a suspended state and then asked the debugger to attach.
|
||||
*/
|
||||
startMethod?: 'launch' | 'attach' | 'attachForSuspendedLaunch';
|
||||
/** The size of a pointer or address for this process, in bits. This value may be used by clients when formatting addresses for display. */
|
||||
pointerSize?: number;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -325,8 +323,6 @@ declare module DebugProtocol {
|
||||
supportsVariablePaging?: boolean;
|
||||
/** Client supports the runInTerminal request. */
|
||||
supportsRunInTerminalRequest?: boolean;
|
||||
/** Client supports memory references. */
|
||||
supportsMemoryReferences?: boolean;
|
||||
}
|
||||
|
||||
/** Response to 'initialize' request. */
|
||||
@@ -1051,8 +1047,6 @@ declare module DebugProtocol {
|
||||
The client can use this optional information to present the variables in a paged UI and fetch them in chunks.
|
||||
*/
|
||||
indexedVariables?: number;
|
||||
/** Memory reference to a location appropriate for this result. For pointer type eval results, this is generally a reference to the memory address contained in the pointer. */
|
||||
memoryReference?: string;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1208,66 +1202,6 @@ declare module DebugProtocol {
|
||||
};
|
||||
}
|
||||
|
||||
/** ReadMemory request; value of command field is 'readMemory'.
|
||||
Reads bytes from memory at the provided location.
|
||||
*/
|
||||
export interface ReadMemoryRequest extends Request {
|
||||
// command: 'readMemory';
|
||||
arguments: ReadMemoryArguments;
|
||||
}
|
||||
|
||||
/** Arguments for 'readMemory' request. */
|
||||
export interface ReadMemoryArguments {
|
||||
/** Memory reference to the base location from which data should be read. */
|
||||
memoryReference: string;
|
||||
/** Optional offset (in bytes) to be applied to the reference location before reading data. Can be negative. */
|
||||
offset?: number;
|
||||
/** Number of bytes to read at the specified location and offset. */
|
||||
count: number;
|
||||
}
|
||||
|
||||
/** Response to 'readMemory' request. */
|
||||
export interface ReadMemoryResponse extends Response {
|
||||
body?: {
|
||||
/** The address of the first byte of data returned. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise. */
|
||||
address: string;
|
||||
/** The number of unreadable bytes encountered after the last successfully read byte. This can be used to determine the number of bytes that must be skipped before a subsequent 'readMemory' request will succeed. */
|
||||
unreadableBytes?: number;
|
||||
/** The bytes read from memory, encoded using base64. */
|
||||
data?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/** Disassemble request; value of command field is 'disassemble'.
|
||||
Disassembles code stored at the provided location.
|
||||
*/
|
||||
export interface DisassembleRequest extends Request {
|
||||
// command: 'disassemble';
|
||||
arguments: DisassembleArguments;
|
||||
}
|
||||
|
||||
/** Arguments for 'disassemble' request. */
|
||||
export interface DisassembleArguments {
|
||||
/** Memory reference to the base location containing the instructions to disassemble. */
|
||||
memoryReference: string;
|
||||
/** Optional offset (in bytes) to be applied to the reference location before disassembling. Can be negative. */
|
||||
offset?: number;
|
||||
/** Optional offset (in instructions) to be applied after the byte offset (if any) before disassembling. Can be negative. */
|
||||
instructionOffset?: number;
|
||||
/** Number of instructions to disassemble starting at the specified location and offset. An adapter must return exactly this number of instructions - any unavailable instructions should be replaced with an implementation-defined 'invalid instruction' value. */
|
||||
instructionCount: number;
|
||||
/** If true, the adapter should attempt to resolve memory addresses and other values to symbolic names. */
|
||||
resolveSymbols?: boolean;
|
||||
}
|
||||
|
||||
/** Response to 'disassemble' request. */
|
||||
export interface DisassembleResponse extends Response {
|
||||
body?: {
|
||||
/** The list of disassembled instructions. */
|
||||
instructions: DisassembledInstruction[];
|
||||
};
|
||||
}
|
||||
|
||||
/** Information about the capabilities of a debug adapter. */
|
||||
export interface Capabilities {
|
||||
/** The debug adapter supports the 'configurationDone' request. */
|
||||
@@ -1324,10 +1258,6 @@ declare module DebugProtocol {
|
||||
supportsTerminateRequest?: boolean;
|
||||
/** The debug adapter supports data breakpoints. */
|
||||
supportsDataBreakpoints?: boolean;
|
||||
/** The debug adapter supports the 'readMemory' request. */
|
||||
supportsReadMemoryRequest?: boolean;
|
||||
/** The debug adapter supports the 'disassemble' request. */
|
||||
supportsDisassembleRequest?: boolean;
|
||||
}
|
||||
|
||||
/** An ExceptionBreakpointsFilter is shown in the UI as an option for configuring how exceptions are dealt with. */
|
||||
@@ -1463,8 +1393,6 @@ declare module DebugProtocol {
|
||||
endLine?: number;
|
||||
/** An optional end column of the range covered by the stack frame. */
|
||||
endColumn?: number;
|
||||
/** Optional memory reference for the current instruction pointer in this frame. */
|
||||
instructionPointerReference?: string;
|
||||
/** The module associated with this frame, if any. */
|
||||
moduleId?: number | string;
|
||||
/** An optional hint for how to present this frame in the UI. A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of 'subtle' can be used to change the appearance of a frame in a 'subtle' way. */
|
||||
@@ -1473,16 +1401,8 @@ declare module DebugProtocol {
|
||||
|
||||
/** A Scope is a named container for variables. Optionally a scope can map to a source or a range within a source. */
|
||||
export interface Scope {
|
||||
/** Name of the scope such as 'Arguments', 'Locals', or 'Registers'. This string is shown in the UI as is and can be translated. */
|
||||
/** Name of the scope such as 'Arguments', 'Locals'. */
|
||||
name: string;
|
||||
/** An optional hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI.
|
||||
Values:
|
||||
'arguments': Scope contains method arguments.
|
||||
'locals': Scope contains local variables.
|
||||
'registers': Scope contains registers. Only a single 'registers' scope should be returned from a 'scopes' request.
|
||||
etc.
|
||||
*/
|
||||
presentationHint?: string;
|
||||
/** The variables of this scope can be retrieved by passing the value of variablesReference to the VariablesRequest. */
|
||||
variablesReference: number;
|
||||
/** The number of named variables in this scope.
|
||||
@@ -1535,8 +1455,6 @@ declare module DebugProtocol {
|
||||
The client can use this optional information to present the children in a paged UI and fetch them in chunks.
|
||||
*/
|
||||
indexedVariables?: number;
|
||||
/** Optional memory reference for the variable if the variable represents executable code, such as a function pointer. */
|
||||
memoryReference?: string;
|
||||
}
|
||||
|
||||
/** Optional properties of a variable that can be used to determine how to render the variable in the UI. */
|
||||
@@ -1658,8 +1576,6 @@ declare module DebugProtocol {
|
||||
endLine?: number;
|
||||
/** An optional end column of the range covered by the goto target. */
|
||||
endColumn?: number;
|
||||
/** Optional memory reference for the instruction pointer value represented by this target. */
|
||||
instructionPointerReference?: string;
|
||||
}
|
||||
|
||||
/** CompletionItems are the suggestions returned from the CompletionsRequest. */
|
||||
@@ -1757,27 +1673,5 @@ declare module DebugProtocol {
|
||||
/** Details of the exception contained by this exception, if any. */
|
||||
innerException?: ExceptionDetails[];
|
||||
}
|
||||
|
||||
/** Represents a single disassembled instruction. */
|
||||
export interface DisassembledInstruction {
|
||||
/** The address of the instruction. Treated as a hex value if prefixed with '0x', or as a decimal value otherwise. */
|
||||
address: string;
|
||||
/** Optional raw bytes representing the instruction and its operands, in an implementation-defined format. */
|
||||
instructionBytes?: string;
|
||||
/** Text representing the instruction and its operands, in an implementation-defined format. */
|
||||
instruction: string;
|
||||
/** Name of the symbol that correponds with the location of this instruction, if any. */
|
||||
symbol?: string;
|
||||
/** Source location that corresponds to this instruction, if any. Should always be set (if available) on the first instruction returned, but can be omitted afterwards if this instruction maps to the same source file as the previous instruction. */
|
||||
location?: Source;
|
||||
/** The line within the source location that corresponds to this instruction, if any. */
|
||||
line?: number;
|
||||
/** The column within the line that corresponds to this instruction, if any. */
|
||||
column?: number;
|
||||
/** The end line of the range that corresponds to this instruction, if any. */
|
||||
endLine?: number;
|
||||
/** The end column of the range that corresponds to this instruction, if any. */
|
||||
endColumn?: number;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ export const debuggersExtPoint = extensionsRegistry.ExtensionsRegistry.registerE
|
||||
type: 'array'
|
||||
},
|
||||
variables: {
|
||||
description: nls.localize('vscode.extension.contributes.debuggers.variables', "Mapping from interactive variables (e.g. ${action.pickProcess}) in `launch.json` to a command."),
|
||||
description: nls.localize('vscode.extension.contributes.debuggers.variables', "Mapping from interactive variables (e.g ${action.pickProcess}) in `launch.json` to a command."),
|
||||
type: 'object'
|
||||
},
|
||||
initialConfigurations: {
|
||||
|
||||
@@ -12,7 +12,6 @@ import { IRange } from 'vs/editor/common/core/range';
|
||||
import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { isUri } from 'vs/workbench/contrib/debug/common/debugUtils';
|
||||
import { ITextEditor } from 'vs/workbench/common/editor';
|
||||
|
||||
export const UNKNOWN_SOURCE_LABEL = nls.localize('unknownSource', "Unknown Source");
|
||||
|
||||
@@ -26,6 +25,7 @@ export const UNKNOWN_SOURCE_LABEL = nls.localize('unknownSource', "Unknown Sourc
|
||||
* | | | |
|
||||
* scheme source.path session id source.reference
|
||||
*
|
||||
* the arbitrary_path and the session id are encoded with 'encodeURIComponent'
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -48,11 +48,7 @@ export class Source {
|
||||
}
|
||||
|
||||
if (typeof this.raw.sourceReference === 'number' && this.raw.sourceReference > 0) {
|
||||
this.uri = uri.from({
|
||||
scheme: DEBUG_SCHEME,
|
||||
path,
|
||||
query: `session=${sessionId}&ref=${this.raw.sourceReference}`
|
||||
});
|
||||
this.uri = uri.parse(`${DEBUG_SCHEME}:${encodeURIComponent(path)}?session=${encodeURIComponent(sessionId)}&ref=${this.raw.sourceReference}`);
|
||||
} else {
|
||||
if (isUri(path)) { // path looks like a uri
|
||||
this.uri = uri.parse(path);
|
||||
@@ -63,11 +59,7 @@ export class Source {
|
||||
} else {
|
||||
// path is relative: since VS Code cannot deal with this by itself
|
||||
// create a debug url that will result in a DAP 'source' request when the url is resolved.
|
||||
this.uri = uri.from({
|
||||
scheme: DEBUG_SCHEME,
|
||||
path,
|
||||
query: `session=${sessionId}`
|
||||
});
|
||||
this.uri = uri.parse(`${DEBUG_SCHEME}:${encodeURIComponent(path)}?session=${encodeURIComponent(sessionId)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,13 +85,14 @@ export class Source {
|
||||
return this.uri.scheme === DEBUG_SCHEME;
|
||||
}
|
||||
|
||||
openInEditor(editorService: IEditorService, selection: IRange, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): Promise<ITextEditor | null> {
|
||||
openInEditor(editorService: IEditorService, selection: IRange, preserveFocus?: boolean, sideBySide?: boolean, pinned?: boolean): Promise<any> {
|
||||
return !this.available ? Promise.resolve(null) : editorService.openEditor({
|
||||
resource: this.uri,
|
||||
description: this.origin,
|
||||
options: {
|
||||
preserveFocus,
|
||||
selection,
|
||||
revealIfVisible: true,
|
||||
revealIfOpened: true,
|
||||
revealInCenterIfOutsideViewport: true,
|
||||
pinned: pinned || (!preserveFocus && !this.inMemory)
|
||||
@@ -125,7 +118,7 @@ export class Source {
|
||||
if (pair.length === 2) {
|
||||
switch (pair[0]) {
|
||||
case 'session':
|
||||
sessionId = pair[1];
|
||||
sessionId = decodeURIComponent(pair[1]);
|
||||
break;
|
||||
case 'ref':
|
||||
sourceReference = parseInt(pair[1]);
|
||||
|
||||
@@ -15,6 +15,8 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'v
|
||||
import { IWorkbenchActionRegistry, Extensions as WorkbenchActionRegistryExtensions } from 'vs/workbench/common/actions';
|
||||
import { ShowViewletAction, Extensions as ViewletExtensions, ViewletRegistry, ViewletDescriptor } from 'vs/workbench/browser/viewlet';
|
||||
import { TogglePanelAction, Extensions as PanelExtensions, PanelRegistry, PanelDescriptor } from 'vs/workbench/browser/panel';
|
||||
import { StatusbarItemDescriptor, IStatusbarRegistry, Extensions as StatusExtensions } from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||
import { StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { BreakpointsView } from 'vs/workbench/contrib/debug/browser/breakpointsView';
|
||||
import { CallStackView } from 'vs/workbench/contrib/debug/browser/callStackView';
|
||||
import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
@@ -38,7 +40,7 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { DebugViewlet } from 'vs/workbench/contrib/debug/browser/debugViewlet';
|
||||
import { DebugQuickOpenHandler } from 'vs/workbench/contrib/debug/browser/debugQuickOpen';
|
||||
import { DebugStatusContribution } from 'vs/workbench/contrib/debug/browser/debugStatus';
|
||||
import { DebugStatus } from 'vs/workbench/contrib/debug/browser/debugStatus';
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { launchSchemaId } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
@@ -257,7 +259,8 @@ configurationRegistry.registerConfiguration({
|
||||
});
|
||||
|
||||
// Register Debug Status
|
||||
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugStatusContribution, LifecyclePhase.Eventually);
|
||||
const statusBar = Registry.as<IStatusbarRegistry>(StatusExtensions.Statusbar);
|
||||
statusBar.registerStatusbarItem(new StatusbarItemDescriptor(DebugStatus, StatusbarAlignment.LEFT, 30 /* Low Priority */));
|
||||
|
||||
// Debug toolbar
|
||||
|
||||
@@ -534,9 +537,7 @@ if (isMacintosh) {
|
||||
const registerTouchBarEntry = (id: string, title: string, order: number, when: ContextKeyExpr, icon: string) => {
|
||||
MenuRegistry.appendMenuItem(MenuId.TouchBarContext, {
|
||||
command: {
|
||||
id,
|
||||
title,
|
||||
iconLocation: { dark: URI.parse(require.toUrl(`vs/workbench/contrib/debug/electron-browser/media/${icon}`)) }
|
||||
id, title, iconLocation: { dark: URI.parse(require.toUrl(`vs/workbench/contrib/debug/electron-browser/media/${icon}`)) }
|
||||
},
|
||||
when,
|
||||
group: '9_debug',
|
||||
@@ -548,9 +549,9 @@ if (isMacintosh) {
|
||||
registerTouchBarEntry(RunAction.ID, RunAction.LABEL, 1, CONTEXT_IN_DEBUG_MODE.toNegated(), 'continue-without-debugging-tb.png');
|
||||
registerTouchBarEntry(CONTINUE_ID, continueLabel, 0, CONTEXT_DEBUG_STATE.isEqualTo('stopped'), 'continue-tb.png');
|
||||
registerTouchBarEntry(PAUSE_ID, pauseLabel, 1, ContextKeyExpr.and(CONTEXT_IN_DEBUG_MODE, ContextKeyExpr.notEquals('debugState', 'stopped')), 'pause-tb.png');
|
||||
registerTouchBarEntry(STEP_OVER_ID, stepOverLabel, 2, CONTEXT_IN_DEBUG_MODE, 'stepover-tb.png');
|
||||
registerTouchBarEntry(STEP_INTO_ID, stepIntoLabel, 3, CONTEXT_IN_DEBUG_MODE, 'stepinto-tb.png');
|
||||
registerTouchBarEntry(STEP_OUT_ID, stepOutLabel, 4, CONTEXT_IN_DEBUG_MODE, 'stepout-tb.png');
|
||||
registerTouchBarEntry(STEP_OVER_ID, stepOverLabel, 2, CONTEXT_DEBUG_STATE.isEqualTo('stopped'), 'stepover-tb.png');
|
||||
registerTouchBarEntry(STEP_INTO_ID, stepIntoLabel, 3, CONTEXT_DEBUG_STATE.isEqualTo('stopped'), 'stepinto-tb.png');
|
||||
registerTouchBarEntry(STEP_OUT_ID, stepOutLabel, 4, CONTEXT_DEBUG_STATE.isEqualTo('stopped'), 'stepout-tb.png');
|
||||
registerTouchBarEntry(RESTART_SESSION_ID, restartLabel, 5, CONTEXT_IN_DEBUG_MODE, 'restart-tb.png');
|
||||
registerTouchBarEntry(STOP_ID, stopLabel, 6, CONTEXT_IN_DEBUG_MODE, 'stop-tb.png');
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export class ConfigurationManager implements IConfigurationManager {
|
||||
private _onDidSelectConfigurationName = new Emitter<void>();
|
||||
private configProviders: IDebugConfigurationProvider[];
|
||||
private adapterDescriptorFactories: IDebugAdapterDescriptorFactory[];
|
||||
private debugAdapterFactories = new Map<string, IDebugAdapterFactory>();
|
||||
private debugAdapterFactories: Map<string, IDebugAdapterFactory>;
|
||||
private terminalLauncher: ITerminalLauncher;
|
||||
private debugConfigurationTypeContext: IContextKey<string>;
|
||||
|
||||
@@ -78,6 +78,7 @@ export class ConfigurationManager implements IConfigurationManager {
|
||||
const previousSelectedRoot = this.storageService.get(DEBUG_SELECTED_ROOT, StorageScope.WORKSPACE);
|
||||
const previousSelectedLaunch = this.launches.filter(l => l.uri.toString() === previousSelectedRoot).pop();
|
||||
this.debugConfigurationTypeContext = CONTEXT_DEBUG_CONFIGURATION_TYPE.bindTo(contextKeyService);
|
||||
this.debugAdapterFactories = new Map();
|
||||
if (previousSelectedLaunch) {
|
||||
this.selectConfiguration(previousSelectedLaunch, this.storageService.get(DEBUG_SELECTED_CONFIG_NAME_KEY, StorageScope.WORKSPACE));
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ import { isExtensionHostDebugging } from 'vs/workbench/contrib/debug/common/debu
|
||||
import { isErrorWithActions, createErrorWithActions } from 'vs/base/common/errorsWithActions';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { IExtensionHostDebugService } from 'vs/workbench/services/extensions/common/extensionHostDebug';
|
||||
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
|
||||
const DEBUG_BREAKPOINTS_KEY = 'debug.breakpoint';
|
||||
const DEBUG_BREAKPOINTS_ACTIVATED_KEY = 'debug.breakpointactivated';
|
||||
@@ -432,6 +431,9 @@ export class DebugService implements IDebugService {
|
||||
|
||||
return this.launchOrAttachToSession(session).then(() => {
|
||||
|
||||
// since the initialized response has arrived announce the new Session (including extensions)
|
||||
this._onDidNewSession.fire(session);
|
||||
|
||||
const internalConsoleOptions = session.configuration.internalConsoleOptions || this.configurationService.getValue<IDebugConfiguration>('debug').internalConsoleOptions;
|
||||
if (internalConsoleOptions === 'openOnSessionStart' || (this.viewModel.firstSessionStart && internalConsoleOptions === 'openOnFirstSessionStart')) {
|
||||
this.panelService.openPanel(REPL_ID, false);
|
||||
@@ -445,9 +447,6 @@ export class DebugService implements IDebugService {
|
||||
this.viewModel.setMultiSessionView(true);
|
||||
}
|
||||
|
||||
// since the initialized response has arrived announce the new Session (including extensions)
|
||||
this._onDidNewSession.fire(session);
|
||||
|
||||
return this.telemetryDebugSessionStart(root, session.configuration.type);
|
||||
}).then(() => true, (error: Error | string) => {
|
||||
|
||||
@@ -659,9 +658,9 @@ export class DebugService implements IDebugService {
|
||||
return Promise.resolve(config);
|
||||
}
|
||||
|
||||
private showError(message: string, errorActions: ReadonlyArray<IAction> = []): Promise<void> {
|
||||
private showError(message: string, actions: IAction[] = []): Promise<void> {
|
||||
const configureAction = this.instantiationService.createInstance(debugactions.ConfigureAction, debugactions.ConfigureAction.ID, debugactions.ConfigureAction.LABEL);
|
||||
const actions = [...errorActions, configureAction];
|
||||
actions.push(configureAction);
|
||||
return this.dialogService.show(severity.Error, message, actions.map(a => a.label).concat(nls.localize('cancel', "Cancel")), { cancelId: actions.length }).then(choice => {
|
||||
if (choice < actions.length) {
|
||||
return actions[choice].run();
|
||||
@@ -790,15 +789,8 @@ export class DebugService implements IDebugService {
|
||||
}
|
||||
|
||||
if (stackFrame) {
|
||||
stackFrame.openInEditor(this.editorService, true).then(editor => {
|
||||
if (editor) {
|
||||
const control = editor.getControl();
|
||||
if (stackFrame && isCodeEditor(control) && control.hasModel()) {
|
||||
const lineContent = control.getModel().getLineContent(stackFrame.range.startLineNumber);
|
||||
aria.alert(nls.localize('debuggingPaused', "Debugging paused {0}, {1} {2} {3}", thread && thread.stoppedDetails ? `, reason ${thread.stoppedDetails.reason}` : '', stackFrame.source ? stackFrame.source.name : '', stackFrame.range.startLineNumber, lineContent));
|
||||
}
|
||||
}
|
||||
});
|
||||
stackFrame.openInEditor(this.editorService, true);
|
||||
aria.alert(nls.localize('debuggingPaused', "Debugging paused {0}, {1} {2}", thread && thread.stoppedDetails ? `, reason ${thread.stoppedDetails.reason}` : '', stackFrame.source ? stackFrame.source.name : '', stackFrame.range.startLineNumber));
|
||||
}
|
||||
if (session) {
|
||||
this.debugType.set(session.configuration.type);
|
||||
@@ -854,7 +846,7 @@ export class DebugService implements IDebugService {
|
||||
return this.sendBreakpoints(uri).then(() => breakpoints);
|
||||
}
|
||||
|
||||
updateBreakpoints(uri: uri, data: Map<string, DebugProtocol.Breakpoint>, sendOnResourceSaved: boolean): void {
|
||||
updateBreakpoints(uri: uri, data: { [id: string]: DebugProtocol.Breakpoint }, sendOnResourceSaved: boolean): void {
|
||||
this.model.updateBreakpoints(data);
|
||||
if (sendOnResourceSaved) {
|
||||
this.breakpointsToSendOnResourceSaved.add(uri.toString());
|
||||
|
||||
@@ -282,14 +282,14 @@ export class DebugSession implements IDebugSession {
|
||||
|
||||
return this.raw.setBreakpoints({
|
||||
source: rawSource,
|
||||
lines: breakpointsToSend.map(bp => bp.sessionAgnosticData.lineNumber),
|
||||
breakpoints: breakpointsToSend.map(bp => ({ line: bp.sessionAgnosticData.lineNumber, column: bp.sessionAgnosticData.column, condition: bp.condition, hitCondition: bp.hitCondition, logMessage: bp.logMessage })),
|
||||
lines: breakpointsToSend.map(bp => bp.lineNumber),
|
||||
breakpoints: breakpointsToSend.map(bp => ({ line: bp.lineNumber, column: bp.column, condition: bp.condition, hitCondition: bp.hitCondition, logMessage: bp.logMessage })),
|
||||
sourceModified
|
||||
}).then(response => {
|
||||
if (response && response.body) {
|
||||
const data = new Map<string, DebugProtocol.Breakpoint>();
|
||||
const data: { [id: string]: DebugProtocol.Breakpoint } = Object.create(null);
|
||||
for (let i = 0; i < breakpointsToSend.length; i++) {
|
||||
data.set(breakpointsToSend[i].getId(), response.body.breakpoints[i]);
|
||||
data[breakpointsToSend[i].getId()] = response.body.breakpoints[i];
|
||||
}
|
||||
|
||||
this.model.setBreakpointSessionData(this.getId(), data);
|
||||
@@ -302,9 +302,9 @@ export class DebugSession implements IDebugSession {
|
||||
if (this.raw.readyForBreakpoints) {
|
||||
return this.raw.setFunctionBreakpoints({ breakpoints: fbpts }).then(response => {
|
||||
if (response && response.body) {
|
||||
const data = new Map<string, DebugProtocol.Breakpoint>();
|
||||
const data: { [id: string]: DebugProtocol.Breakpoint } = Object.create(null);
|
||||
for (let i = 0; i < fbpts.length; i++) {
|
||||
data.set(fbpts[i].getId(), response.body.breakpoints[i]);
|
||||
data[fbpts[i].getId()] = response.body.breakpoints[i];
|
||||
}
|
||||
this.model.setBreakpointSessionData(this.getId(), data);
|
||||
}
|
||||
@@ -753,8 +753,7 @@ export class DebugSession implements IDebugSession {
|
||||
lineNumber: event.body.breakpoint.line,
|
||||
}], false);
|
||||
if (bps.length === 1) {
|
||||
const data = new Map<string, DebugProtocol.Breakpoint>([[bps[0].getId(), event.body.breakpoint]]);
|
||||
this.model.setBreakpointSessionData(this.getId(), data);
|
||||
this.model.setBreakpointSessionData(this.getId(), { [bps[0].getId()]: event.body.breakpoint });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,12 +771,10 @@ export class DebugSession implements IDebugSession {
|
||||
if (!breakpoint.column) {
|
||||
event.body.breakpoint.column = undefined;
|
||||
}
|
||||
const data = new Map<string, DebugProtocol.Breakpoint>([[breakpoint.getId(), event.body.breakpoint]]);
|
||||
this.model.setBreakpointSessionData(this.getId(), data);
|
||||
this.model.setBreakpointSessionData(this.getId(), { [breakpoint.getId()]: event.body.breakpoint });
|
||||
}
|
||||
if (functionBreakpoint) {
|
||||
const data = new Map<string, DebugProtocol.Breakpoint>([[functionBreakpoint.getId(), event.body.breakpoint]]);
|
||||
this.model.setBreakpointSessionData(this.getId(), data);
|
||||
this.model.setBreakpointSessionData(this.getId(), { [functionBreakpoint.getId()]: event.body.breakpoint });
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -487,7 +487,7 @@ export class RawDebugSession {
|
||||
}
|
||||
}
|
||||
|
||||
private async dispatchRequest(request: DebugProtocol.Request, dbgr: IDebugger): Promise<void> {
|
||||
private dispatchRequest(request: DebugProtocol.Request, dbgr: IDebugger): void {
|
||||
|
||||
const response: DebugProtocol.Response = {
|
||||
type: 'response',
|
||||
@@ -528,7 +528,7 @@ export class RawDebugSession {
|
||||
break;
|
||||
case 'handshake':
|
||||
try {
|
||||
const vsda = await import('vsda');
|
||||
const vsda = <any>require.__$__nodeRequire('vsda');
|
||||
const obj = new vsda.signer();
|
||||
const sig = obj.sign(request.arguments.value);
|
||||
response.body = {
|
||||
|
||||
@@ -348,10 +348,8 @@ export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments
|
||||
|
||||
quote = (s: string) => {
|
||||
s = s.replace(/\'/g, '\'\'');
|
||||
if (s.length > 0 && s.charAt(s.length - 1) === '\\') {
|
||||
return `'${s}\\'`;
|
||||
}
|
||||
return `'${s}'`;
|
||||
//return s.indexOf(' ') >= 0 || s.indexOf('\'') >= 0 || s.indexOf('"') >= 0 ? `'${s}'` : s;
|
||||
};
|
||||
|
||||
if (args.cwd) {
|
||||
@@ -409,8 +407,8 @@ export function prepareCommand(args: DebugProtocol.RunInTerminalRequestArguments
|
||||
case ShellType.bash:
|
||||
|
||||
quote = (s: string) => {
|
||||
s = s.replace(/([\"\\])/g, '\\$1');
|
||||
return s.indexOf(' ') >= 0 ? `"${s}"` : s;
|
||||
s = s.replace(/\"/g, '\\"');
|
||||
return (s.indexOf(' ') >= 0 || s.indexOf('\\') >= 0) ? `"${s}"` : s;
|
||||
};
|
||||
|
||||
const hardQuote = (s: string) => {
|
||||
|
||||
@@ -11,9 +11,6 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/
|
||||
import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector';
|
||||
import { Color, RGBA } from 'vs/base/common/color';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { TestThemeService, TestTheme } from 'vs/platform/theme/test/common/testThemeService';
|
||||
import { ansiColorMap } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry';
|
||||
|
||||
suite('Debug - ANSI Handling', () => {
|
||||
test('appendStylizedStringToContainer', () => {
|
||||
|
||||
@@ -51,7 +51,7 @@ export class MockDebugService implements IDebugService {
|
||||
throw new Error('not implemented');
|
||||
}
|
||||
|
||||
public updateBreakpoints(uri: uri, data: Map<string, IBreakpointUpdateData>, sendOnResourceSaved: boolean): void { }
|
||||
public updateBreakpoints(uri: uri, data: { [id: string]: IBreakpointUpdateData }, sendOnResourceSaved: boolean): void { }
|
||||
|
||||
public enableOrDisableBreakpoints(enabled: boolean): Promise<void> {
|
||||
throw new Error('not implemented');
|
||||
|
||||
@@ -12,7 +12,6 @@ import { MockRawSession } from 'vs/workbench/contrib/debug/test/common/mockDebug
|
||||
import { Source } from 'vs/workbench/contrib/debug/common/debugSource';
|
||||
import { DebugSession } from 'vs/workbench/contrib/debug/electron-browser/debugSession';
|
||||
import { ReplModel } from 'vs/workbench/contrib/debug/common/replModel';
|
||||
import { IBreakpointUpdateData } from 'vs/workbench/contrib/debug/common/debug';
|
||||
|
||||
function createMockSession(model: DebugModel, name = 'mockSession', parentSession?: DebugSession | undefined): DebugSession {
|
||||
return new DebugSession({ resolved: { name, type: 'node', request: 'launch' }, unresolved: undefined }, undefined!, model, parentSession, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!, undefined!);
|
||||
@@ -64,8 +63,8 @@ suite('Debug - Model', () => {
|
||||
|
||||
assert.equal(model.getBreakpoints().length, 5);
|
||||
const bp = model.getBreakpoints()[0];
|
||||
const update = new Map<string, IBreakpointUpdateData>();
|
||||
update.set(bp.getId(), { lineNumber: 100 });
|
||||
const update: any = {};
|
||||
update[bp.getId()] = { lineNumber: 100 };
|
||||
model.updateBreakpoints(update);
|
||||
assert.equal(bp.lineNumber, 100);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user