Merge from vscode 2e5312cd61ff99c570299ecc122c52584265eda2

This commit is contained in:
ADS Merger
2020-04-23 02:50:35 +00:00
committed by Anthony Dresser
parent 3603f55d97
commit 7f1d8fc32f
659 changed files with 22709 additions and 12497 deletions

View File

@@ -37,7 +37,7 @@ import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor'
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { Orientation } from 'vs/base/browser/ui/splitview/splitview';
import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
const $ = dom.$;
@@ -100,12 +100,6 @@ export class BreakpointsView extends ViewPane {
identityProvider: { getId: (element: IEnablement) => element.getId() },
multipleSelectionSupport: false,
keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e: IEnablement) => e },
ariaProvider: {
getSetSize: (_: IEnablement, index: number, listLength: number) => listLength,
getPosInSet: (_: IEnablement, index: number) => index,
getRole: (breakpoint: IEnablement) => 'checkbox',
isChecked: (breakpoint: IEnablement) => breakpoint.enabled
},
accessibilityProvider: new BreakpointsAccessibilityProvider(this.debugService),
overrideStyles: {
listBackground: this.getBackgroundColor()
@@ -170,6 +164,7 @@ export class BreakpointsView extends ViewPane {
}
protected layoutBody(height: number, width: number): void {
super.layoutBody(height, width);
if (this.list) {
this.list.layout(height, width);
}
@@ -624,10 +619,22 @@ class FunctionBreakpointInputRenderer implements IListRenderer<IFunctionBreakpoi
}
}
class BreakpointsAccessibilityProvider implements IAccessibilityProvider<BreakpointItem> {
class BreakpointsAccessibilityProvider implements IListAccessibilityProvider<BreakpointItem> {
constructor(private readonly debugService: IDebugService) { }
getWidgetAriaLabel(): string {
return nls.localize('breakpoints', "Breakpoints");
}
getRole() {
return 'checkbox';
}
isChecked(breakpoint: IEnablement) {
return breakpoint.enabled;
}
getAriaLabel(element: BreakpointItem): string | null {
if (element instanceof ExceptionBreakpoint) {
return element.toString();

View File

@@ -145,5 +145,5 @@ registerThemingParticipant((theme, collector) => {
}
});
const topStackFrameColor = registerColor('editor.stackFrameHighlightBackground', { dark: '#ffff0033', light: '#ffff6673', hc: '#fff600' }, localize('topStackFrameLineHighlight', 'Background color for the highlight of line at the top stack frame position.'));
const focusedStackFrameColor = registerColor('editor.focusedStackFrameHighlightBackground', { dark: '#7abd7a4d', light: '#cee7ce73', hc: '#cee7ce' }, localize('focusedStackFrameLineHighlight', 'Background color for the highlight of line at focused stack frame position.'));
const topStackFrameColor = registerColor('editor.stackFrameHighlightBackground', { dark: '#ffff0033', light: '#ffff6673', hc: '#ffff0033' }, localize('topStackFrameLineHighlight', 'Background color for the highlight of line at the top stack frame position.'));
const focusedStackFrameColor = registerColor('editor.focusedStackFrameHighlightBackground', { dark: '#7abd7a4d', light: '#cee7ce73', hc: '#7abd7a4d' }, localize('focusedStackFrameLineHighlight', 'Background color for the highlight of line at focused stack frame position.'));

View File

@@ -20,11 +20,11 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ViewPane } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { ILabelService } from 'vs/platform/label/common/label';
import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { createAndFillInContextMenuActions } from 'vs/platform/actions/browser/menuEntryActionViewItem';
import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
import { ITreeRenderer, ITreeNode, ITreeContextMenuEvent, IAsyncDataSource } from 'vs/base/browser/ui/tree/tree';
import { ResourceNavigator, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
import { TreeResourceNavigator, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
import { createMatches, FuzzyScore } from 'vs/base/common/filters';
import { Event } from 'vs/base/common/event';
@@ -158,7 +158,7 @@ export class CallStackView extends ViewPane {
getActions(): IAction[] {
if (this.pauseMessage.hidden) {
return [new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all')];
return [new CollapseAction(() => this.tree, true, 'explorer-action codicon-collapse-all')];
}
return [];
@@ -180,7 +180,6 @@ export class CallStackView extends ViewPane {
new ShowMoreRenderer(this.themeService)
], this.dataSource, {
accessibilityProvider: new CallStackAccessibilityProvider(),
ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'callStackAriaLabel' }, "Debug Call Stack"),
identityProvider: {
getId: (element: CallStackItem) => {
if (typeof element === 'string') {
@@ -219,7 +218,7 @@ export class CallStackView extends ViewPane {
this.tree.setInput(this.debugService.getModel());
const callstackNavigator = ResourceNavigator.createTreeResourceNavigator(this.tree);
const callstackNavigator = new TreeResourceNavigator(this.tree);
this._register(callstackNavigator);
this._register(callstackNavigator.onDidOpenResource(e => {
if (this.ignoreSelectionChangedEvent) {
@@ -309,6 +308,7 @@ export class CallStackView extends ViewPane {
}
layoutBody(height: number, width: number): void {
super.layoutBody(height, width);
this.tree.layout(height, width);
}
@@ -811,7 +811,12 @@ class CallStackDataSource implements IAsyncDataSource<IDebugModel, CallStackItem
}
}
class CallStackAccessibilityProvider implements IAccessibilityProvider<CallStackItem> {
class CallStackAccessibilityProvider implements IListAccessibilityProvider<CallStackItem> {
getWidgetAriaLabel(): string {
return nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'callStackAriaLabel' }, "Debug Call Stack");
}
getAriaLabel(element: CallStackItem): string {
if (element instanceof Thread) {
return nls.localize('threadAriaLabel', "Thread {0}, callstack, debug", (<Thread>element).name);

View File

@@ -43,7 +43,8 @@ import { VariablesView } from 'vs/workbench/contrib/debug/browser/variablesView'
import { ClearReplAction, Repl } from 'vs/workbench/contrib/debug/browser/repl';
import { DebugContentProvider } from 'vs/workbench/contrib/debug/common/debugContentProvider';
import { WelcomeView } from 'vs/workbench/contrib/debug/browser/welcomeView';
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
import { ThemeIcon, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { registerColor, foreground, badgeBackground, badgeForeground, listDeemphasizedForeground, contrastBorder } from 'vs/platform/theme/common/colorRegistry';
import { DebugViewPaneContainer, OpenDebugConsoleAction } from 'vs/workbench/contrib/debug/browser/debugViewlet';
import { registerEditorContribution } from 'vs/editor/browser/editorExtensions';
import { CallStackEditorContribution } from 'vs/workbench/contrib/debug/browser/callStackEditorContribution';
@@ -74,6 +75,7 @@ const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewCo
name: nls.localize('run', "Run"),
ctorDescriptor: new SyncDescriptor(DebugViewPaneContainer),
icon: 'codicon-debug-alt-2',
alwaysUseContainerInfo: true,
order: 13 // {{SQL CARBON EDIT}}
}, ViewContainerLocation.Sidebar);
@@ -89,7 +91,8 @@ const openPanelKb: IKeybindings = {
const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewContainersRegistry).registerViewContainer({
id: DEBUG_PANEL_ID,
name: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'debugPanel' }, 'Debug Console'),
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [DEBUG_PANEL_ID, DEBUG_PANEL_ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]),
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [DEBUG_PANEL_ID, { mergeViewWithContainerWhenSingleView: true, donotShowContainerTitleWhenMergedWithContainer: true }]),
storageId: DEBUG_PANEL_ID,
focusCommand: {
id: OpenDebugConsoleAction.ID,
keybindings: openPanelKb
@@ -109,19 +112,19 @@ Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry).registerViews([{
// Register default debug views
const viewsRegistry = Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry);
viewsRegistry.registerViews([{ id: VARIABLES_VIEW_ID, name: nls.localize('variables', "Variables"), ctorDescriptor: new SyncDescriptor(VariablesView), order: 10, weight: 40, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusVariablesView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: WATCH_VIEW_ID, name: nls.localize('watch', "Watch"), ctorDescriptor: new SyncDescriptor(WatchExpressionsView), order: 20, weight: 10, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusWatchView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: CALLSTACK_VIEW_ID, name: nls.localize('callStack', "Call Stack"), ctorDescriptor: new SyncDescriptor(CallStackView), order: 30, weight: 30, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusCallStackView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: BREAKPOINTS_VIEW_ID, name: nls.localize('breakpoints', "Breakpoints"), ctorDescriptor: new SyncDescriptor(BreakpointsView), order: 40, weight: 20, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusBreakpointsView' }, when: ContextKeyExpr.or(CONTEXT_BREAKPOINTS_EXIST, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer);
viewsRegistry.registerViews([{ id: WelcomeView.ID, name: WelcomeView.LABEL, ctorDescriptor: new SyncDescriptor(WelcomeView), order: 10, weight: 40, canToggleVisibility: true, when: CONTEXT_DEBUG_UX.isEqualTo('simple') }], viewContainer);
viewsRegistry.registerViews([{ id: LOADED_SCRIPTS_VIEW_ID, name: nls.localize('loadedScripts', "Loaded Scripts"), ctorDescriptor: new SyncDescriptor(LoadedScriptsView), order: 35, weight: 5, canToggleVisibility: true, canMoveView: true, collapsed: true, when: ContextKeyExpr.and(CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer);
viewsRegistry.registerViews([{ id: VARIABLES_VIEW_ID, name: nls.localize('variables', "Variables"), containerIcon: 'codicon-debug-alt-2', ctorDescriptor: new SyncDescriptor(VariablesView), order: 10, weight: 40, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusVariablesView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: WATCH_VIEW_ID, name: nls.localize('watch', "Watch"), containerIcon: 'codicon-debug-alt-2', ctorDescriptor: new SyncDescriptor(WatchExpressionsView), order: 20, weight: 10, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusWatchView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: CALLSTACK_VIEW_ID, name: nls.localize('callStack', "Call Stack"), containerIcon: 'codicon-debug-alt-2', ctorDescriptor: new SyncDescriptor(CallStackView), order: 30, weight: 30, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusCallStackView' }, when: CONTEXT_DEBUG_UX.isEqualTo('default') }], viewContainer);
viewsRegistry.registerViews([{ id: BREAKPOINTS_VIEW_ID, name: nls.localize('breakpoints', "Breakpoints"), containerIcon: 'codicon-debug-alt-2', ctorDescriptor: new SyncDescriptor(BreakpointsView), order: 40, weight: 20, canToggleVisibility: true, canMoveView: true, focusCommand: { id: 'workbench.debug.action.focusBreakpointsView' }, when: ContextKeyExpr.or(CONTEXT_BREAKPOINTS_EXIST, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer);
viewsRegistry.registerViews([{ id: WelcomeView.ID, name: WelcomeView.LABEL, containerIcon: 'codicon-debug-alt-2', ctorDescriptor: new SyncDescriptor(WelcomeView), order: 10, weight: 40, canToggleVisibility: true, when: CONTEXT_DEBUG_UX.isEqualTo('simple') }], viewContainer);
viewsRegistry.registerViews([{ id: LOADED_SCRIPTS_VIEW_ID, name: nls.localize('loadedScripts', "Loaded Scripts"), containerIcon: 'codicon-debug-alt-2', ctorDescriptor: new SyncDescriptor(LoadedScriptsView), order: 35, weight: 5, canToggleVisibility: true, canMoveView: true, collapsed: true, when: ContextKeyExpr.and(CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer);
registerCommands();
// register action to open viewlet
const registry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionRegistryExtensions.WorkbenchActions);
registry.registerWorkbenchAction(SyncActionDescriptor.create(OpenDebugConsoleAction, OpenDebugConsoleAction.ID, OpenDebugConsoleAction.LABEL, openPanelKb), 'View: Debug Console', nls.localize('view', "View"));
registry.registerWorkbenchAction(SyncActionDescriptor.create(OpenDebugViewletAction, OpenDebugViewletAction.ID, OpenDebugViewletAction.LABEL, openViewletKb), 'View: Show Run and Debug', nls.localize('view', "View"));
registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenDebugConsoleAction, openPanelKb), 'View: Debug Console', nls.localize('view', "View"));
registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenDebugViewletAction, openViewletKb), 'View: Show Run and Debug', nls.localize('view', "View"));
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugToolBar, LifecyclePhase.Restored);
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugContentProvider, LifecyclePhase.Eventually);
@@ -130,16 +133,16 @@ Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).regi
const debugCategory = nls.localize('debugCategory', "Debug");
const runCategroy = nls.localize('runCategory', "Run");
registry.registerWorkbenchAction(SyncActionDescriptor.create(StartAction, StartAction.ID, StartAction.LABEL, { primary: KeyCode.F5 }, CONTEXT_IN_DEBUG_MODE.toNegated()), 'Debug: Start Debugging', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.create(ConfigureAction, ConfigureAction.ID, ConfigureAction.LABEL), 'Debug: Open launch.json', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.create(AddFunctionBreakpointAction, AddFunctionBreakpointAction.ID, AddFunctionBreakpointAction.LABEL), 'Debug: Add Function Breakpoint', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.create(ReapplyBreakpointsAction, ReapplyBreakpointsAction.ID, ReapplyBreakpointsAction.LABEL), 'Debug: Reapply All Breakpoints', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.create(RunAction, RunAction.ID, RunAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.F5, mac: { primary: KeyMod.WinCtrl | KeyCode.F5 } }), 'Run: Start Without Debugging', runCategroy);
registry.registerWorkbenchAction(SyncActionDescriptor.create(RemoveAllBreakpointsAction, RemoveAllBreakpointsAction.ID, RemoveAllBreakpointsAction.LABEL), 'Debug: Remove All Breakpoints', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.create(EnableAllBreakpointsAction, EnableAllBreakpointsAction.ID, EnableAllBreakpointsAction.LABEL), 'Debug: Enable All Breakpoints', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.create(DisableAllBreakpointsAction, DisableAllBreakpointsAction.ID, DisableAllBreakpointsAction.LABEL), 'Debug: Disable All Breakpoints', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.create(SelectAndStartAction, SelectAndStartAction.ID, SelectAndStartAction.LABEL), 'Debug: Select and Start Debugging', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.create(ClearReplAction, ClearReplAction.ID, ClearReplAction.LABEL), 'Debug: Clear Console', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(StartAction, { primary: KeyCode.F5 }, CONTEXT_IN_DEBUG_MODE.toNegated()), 'Debug: Start Debugging', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(ConfigureAction), 'Debug: Open launch.json', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(AddFunctionBreakpointAction), 'Debug: Add Function Breakpoint', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(ReapplyBreakpointsAction), 'Debug: Reapply All Breakpoints', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(RunAction, { primary: KeyMod.CtrlCmd | KeyCode.F5, mac: { primary: KeyMod.WinCtrl | KeyCode.F5 } }), 'Run: Start Without Debugging', runCategroy);
registry.registerWorkbenchAction(SyncActionDescriptor.from(RemoveAllBreakpointsAction), 'Debug: Remove All Breakpoints', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(EnableAllBreakpointsAction), 'Debug: Enable All Breakpoints', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(DisableAllBreakpointsAction), 'Debug: Disable All Breakpoints', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(SelectAndStartAction), 'Debug: Select and Start Debugging', debugCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(ClearReplAction), 'Debug: Clear Console', debugCategory);
const registerDebugCommandPaletteItem = (id: string, title: string, when?: ContextKeyExpression, precondition?: ContextKeyExpression) => {
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
@@ -586,3 +589,129 @@ if (isMacintosh) {
registerTouchBarEntry(RESTART_SESSION_ID, RESTART_LABEL, 5, CONTEXT_IN_DEBUG_MODE, URI.parse(require.toUrl('vs/workbench/contrib/debug/browser/media/restart-tb.png')));
registerTouchBarEntry(STOP_ID, STOP_LABEL, 6, CONTEXT_IN_DEBUG_MODE, URI.parse(require.toUrl('vs/workbench/contrib/debug/browser/media/stop-tb.png')));
}
// Color contributions
const debugTokenExpressionName = registerColor('debugTokenExpression.name', { dark: '#c586c0', light: '#9b46b0', hc: foreground }, 'Foreground color for the token names shown in the debug views (ie. the Variables or Watch view).');
const debugTokenExpressionValue = registerColor('debugTokenExpression.value', { dark: '#cccccc99', light: '#6c6c6ccc', hc: foreground }, 'Foreground color for the token values shown in the debug views (ie. the Variables or Watch view).');
const debugTokenExpressionString = registerColor('debugTokenExpression.string', { dark: '#ce9178', light: '#a31515', hc: '#f48771' }, 'Foreground color for strings in the debug views (ie. the Variables or Watch view).');
const debugTokenExpressionBoolean = registerColor('debugTokenExpression.boolean', { dark: '#4e94ce', light: '#0000ff', hc: '#75bdfe' }, 'Foreground color for booleans in the debug views (ie. the Variables or Watch view).');
const debugTokenExpressionNumber = registerColor('debugTokenExpression.number', { dark: '#b5cea8', light: '#098658', hc: '#89d185' }, 'Foreground color for numbers in the debug views (ie. the Variables or Watch view).');
const debugTokenExpressionError = registerColor('debugTokenExpression.error', { dark: '#f48771', light: '#e51400', hc: '#f48771' }, 'Foreground color for expression errors in the debug views (ie. the Variables or Watch view) and for error logs shown in the debug console.');
const debugViewExceptionLabelForeground = registerColor('debugView.exceptionLabelForeground', { dark: foreground, light: foreground, hc: foreground }, 'Foreground color for a label shown in the CALL STACK view when the debugger breaks on an exception.');
const debugViewExceptionLabelBackground = registerColor('debugView.exceptionLabelBackground', { dark: '#6C2022', light: '#A31515', hc: '#6C2022' }, 'Background color for a label shown in the CALL STACK view when the debugger breaks on an exception.');
const debugViewStateLabelForeground = registerColor('debugView.stateLabelForeground', { dark: foreground, light: foreground, hc: foreground }, 'Foreground color for a label in the CALL STACK view showing the current session\'s or thread\'s state.');
const debugViewStateLabelBackground = registerColor('debugView.stateLabelBackground', { dark: '#88888844', light: '#88888844', hc: '#88888844' }, 'Background color for a label in the CALL STACK view showing the current session\'s or thread\'s state.');
const debugViewValueChangedHighlight = registerColor('debugView.valueChangedHighlight', { dark: '#569CD6', light: '#569CD6', hc: '#569CD6' }, 'Color used to highlight value changes in the debug views (ie. in the Variables view).');
registerThemingParticipant((theme, collector) => {
// All these colours provide a default value so they will never be undefined, hence the `!`
const badgeBackgroundColor = theme.getColor(badgeBackground)!;
const badgeForegroundColor = theme.getColor(badgeForeground)!;
const listDeemphasizedForegroundColor = theme.getColor(listDeemphasizedForeground)!;
const debugViewExceptionLabelForegroundColor = theme.getColor(debugViewExceptionLabelForeground)!;
const debugViewExceptionLabelBackgroundColor = theme.getColor(debugViewExceptionLabelBackground)!;
const debugViewStateLabelForegroundColor = theme.getColor(debugViewStateLabelForeground)!;
const debugViewStateLabelBackgroundColor = theme.getColor(debugViewStateLabelBackground)!;
const debugViewValueChangedHighlightColor = theme.getColor(debugViewValueChangedHighlight)!;
collector.addRule(`
/* Text colour of the call stack row's filename */
.debug-pane .debug-call-stack .monaco-list-row:not(.selected) .stack-frame > .file .file-name {
color: ${listDeemphasizedForegroundColor}
}
/* Line & column number "badge" for selected call stack row */
.debug-pane .monaco-list-row.selected .line-number {
background-color: ${badgeBackgroundColor};
color: ${badgeForegroundColor};
}
/* Line & column number "badge" for unselected call stack row (basically all other rows) */
.debug-pane .line-number {
background-color: ${badgeBackgroundColor.transparent(0.6)};
color: ${badgeForegroundColor.transparent(0.6)};
}
/* State "badge" displaying the active session's current state.
* Only visible when there are more active debug sessions/threads running.
*/
.debug-pane .debug-call-stack .thread > .state > .label,
.debug-pane .debug-call-stack .session > .state > .label,
.debug-pane .monaco-list-row.selected .thread > .state > .label,
.debug-pane .monaco-list-row.selected .session > .state > .label {
background-color: ${debugViewStateLabelBackgroundColor};
color: ${debugViewStateLabelForegroundColor};
}
/* Info "badge" shown when the debugger pauses due to a thrown exception. */
.debug-pane .debug-call-stack-title > .pause-message > .label.exception {
background-color: ${debugViewExceptionLabelBackgroundColor};
color: ${debugViewExceptionLabelForegroundColor};
}
/* Animation of changed values in Debug viewlet */
@keyframes debugViewletValueChanged {
0% { background-color: ${debugViewValueChangedHighlightColor.transparent(0)} }
5% { background-color: ${debugViewValueChangedHighlightColor.transparent(0.9)} }
100% { background-color: ${debugViewValueChangedHighlightColor.transparent(0.3)} }
}
.debug-pane .monaco-list-row .expression .value.changed {
background-color: ${debugViewValueChangedHighlightColor.transparent(0.3)};
animation-name: debugViewletValueChanged;
animation-duration: 1s;
animation-fill-mode: forwards;
}
`);
const contrastBorderColor = theme.getColor(contrastBorder);
if (contrastBorderColor) {
collector.addRule(`
.debug-pane .line-number {
border: 1px solid ${contrastBorderColor};
}
`);
}
const tokenNameColor = theme.getColor(debugTokenExpressionName)!;
const tokenValueColor = theme.getColor(debugTokenExpressionValue)!;
const tokenStringColor = theme.getColor(debugTokenExpressionString)!;
const tokenBooleanColor = theme.getColor(debugTokenExpressionBoolean)!;
const tokenErrorColor = theme.getColor(debugTokenExpressionError)!;
const tokenNumberColor = theme.getColor(debugTokenExpressionNumber)!;
collector.addRule(`
.monaco-workbench .monaco-list-row .expression .name {
color: ${tokenNameColor};
}
.monaco-workbench .monaco-list-row .expression .value,
.monaco-workbench .debug-hover-widget .value {
color: ${tokenValueColor};
}
.monaco-workbench .monaco-list-row .expression .value.string,
.monaco-workbench .debug-hover-widget .value.string {
color: ${tokenStringColor};
}
.monaco-workbench .monaco-list-row .expression .value.boolean,
.monaco-workbench .debug-hover-widget .value.boolean {
color: ${tokenBooleanColor};
}
.monaco-workbench .monaco-list-row .expression .error,
.monaco-workbench .debug-hover-widget .error,
.monaco-workbench .debug-pane .debug-variables .scope .error {
color: ${tokenErrorColor};
}
.monaco-workbench .monaco-list-row .expression .value.number,
.monaco-workbench .debug-hover-widget .value.number {
color: ${tokenNumberColor};
}
`);
});

View File

@@ -20,6 +20,8 @@ import { selectBorder } from 'vs/platform/theme/common/colorRegistry';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { ADD_CONFIGURATION_ID } from 'vs/workbench/contrib/debug/browser/debugCommands';
import { StartAction } from 'vs/workbench/contrib/debug/browser/debugActions';
const $ = dom.$;
@@ -153,7 +155,7 @@ export class StartDebugActionViewItem implements IActionViewItem {
this.toDispose = dispose(this.toDispose);
}
private updateOptions(): void {
private async updateOptions(): Promise<void> {
this.selected = 0;
this.options = [];
const manager = this.debugService.getConfigurationManager();
@@ -173,7 +175,13 @@ export class StartDebugActionViewItem implements IActionViewItem {
}
const label = inWorkspace ? `${name} (${launch.name})` : name;
this.options.push({ label, handler: () => { manager.selectConfiguration(launch, name); return true; } });
this.options.push({
label, handler: () => {
StartAction.GET_CONFIG_AND_LAUNCH = undefined;
manager.selectConfiguration(launch, name);
return true;
}
});
});
if (this.options.length === 0) {
@@ -183,11 +191,26 @@ export class StartDebugActionViewItem implements IActionViewItem {
disabledIdxs.push(this.options.length - 1);
}
const providers = await manager.getDynamicProviders();
providers.forEach(p => {
this.options.push({
label: `${p.label}...`, handler: () => {
StartAction.GET_CONFIG_AND_LAUNCH = p.pick;
return true;
}
});
});
if (providers.length > 0) {
this.options.push({ label: StartDebugActionViewItem.SEPARATOR, handler: undefined });
disabledIdxs.push(this.options.length - 1);
}
manager.getLaunches().filter(l => !l.hidden).forEach(l => {
const label = inWorkspace ? nls.localize("addConfigTo", "Add Config ({0})...", l.name) : nls.localize('addConfiguration', "Add Configuration...");
this.options.push({
label, handler: () => {
this.commandService.executeCommand('debug.addConfiguration', l.uri.toString());
this.commandService.executeCommand(ADD_CONFIGURATION_ID, l.uri.toString());
return false;
}
});

View File

@@ -7,7 +7,7 @@ import * as nls from 'vs/nls';
import { Action } from 'vs/base/common/actions';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
import { IDebugService, State, IEnablement, IBreakpoint, IDebugSession, ILaunch } from 'vs/workbench/contrib/debug/common/debug';
import { IDebugService, State, IEnablement, IBreakpoint, IDebugSession, ILaunch, IConfig } from 'vs/workbench/contrib/debug/common/debug';
import { Variable, Breakpoint, FunctionBreakpoint } from 'vs/workbench/contrib/debug/common/debugModel';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { INotificationService } from 'vs/platform/notification/common/notification';
@@ -114,6 +114,7 @@ export class ConfigureAction extends AbstractDebugAction {
export class StartAction extends AbstractDebugAction {
static ID = 'workbench.action.debug.start';
static LABEL = nls.localize('startDebug', "Start Debugging");
static GET_CONFIG_AND_LAUNCH: (() => Promise<{ config: IConfig, launch: ILaunch } | undefined>) | undefined;
constructor(id: string, label: string,
@IDebugService debugService: IDebugService,
@@ -128,9 +129,17 @@ export class StartAction extends AbstractDebugAction {
this._register(this.contextService.onDidChangeWorkbenchState(() => this.updateEnablement()));
}
run(): Promise<boolean> {
const { launch, name } = this.debugService.getConfigurationManager().selectedConfiguration;
return this.debugService.startDebugging(launch, name, { noDebug: this.isNoDebug() });
async run(): Promise<boolean> {
if (StartAction.GET_CONFIG_AND_LAUNCH) {
const picked = await StartAction.GET_CONFIG_AND_LAUNCH();
if (picked) {
return this.debugService.startDebugging(picked.launch, picked.config, { noDebug: this.isNoDebug() });
}
return Promise.resolve(false);
} else {
let { launch, name } = this.debugService.getConfigurationManager().selectedConfiguration;
return this.debugService.startDebugging(launch, name, { noDebug: this.isNoDebug() });
}
}
protected isNoDebug(): boolean {

View File

@@ -258,7 +258,7 @@ export function registerCommands(): void {
KeybindingsRegistry.registerCommandAndKeybindingRule({
id: PAUSE_ID,
weight: KeybindingWeight.WorkbenchContrib,
weight: KeybindingWeight.WorkbenchContrib + 2, // take priority over focus next part while we are debugging
primary: KeyCode.F6,
when: CONTEXT_DEBUG_STATE.isEqualTo('running'),
handler: (accessor: ServicesAccessor, _: string, context: CallStackContext | unknown) => {

View File

@@ -32,12 +32,13 @@ import { launchSchema, debuggersExtPoint, breakpointsExtPoint } from 'vs/workben
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { CancellationToken } from 'vs/base/common/cancellation';
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
import { withUndefinedAsNull } from 'vs/base/common/types';
import { sequence } from 'vs/base/common/async';
import { IHistoryService } from 'vs/workbench/services/history/common/history';
import { first } from 'vs/base/common/arrays';
import { getVisibleAndSorted } from 'vs/workbench/contrib/debug/common/debugUtils';
import { DebugConfigurationProviderScope } from 'vs/workbench/api/common/extHostTypes';
const jsonRegistry = Registry.as<IJSONContributionRegistry>(JSONExtensions.JSONContribution);
jsonRegistry.registerSchema(launchSchemaId, launchSchema);
@@ -162,8 +163,8 @@ export class ConfigurationManager implements IConfigurationManager {
return Promise.resolve(undefined);
}
getDebuggerLabel(session: IDebugSession): string | undefined {
const dbgr = this.getDebugger(session.configuration.type);
getDebuggerLabel(type: string): string | undefined {
const dbgr = this.getDebugger(type);
if (dbgr) {
return dbgr.label;
}
@@ -193,9 +194,15 @@ export class ConfigurationManager implements IConfigurationManager {
}
}
hasDebugConfigurationProvider(debugType: string): boolean {
/**
* if scope is not specified,a value of DebugConfigurationProviderScope.Initialization is assumed.
*/
hasDebugConfigurationProvider(debugType: string, scope?: DebugConfigurationProviderScope): boolean {
if (scope === undefined) {
scope = DebugConfigurationProviderScope.Initial;
}
// check if there are providers for the given type that contribute a provideDebugConfigurations method
const providers = this.configProviders.filter(p => p.provideDebugConfigurations && (p.type === debugType));
const providers = this.configProviders.filter(p => p.provideDebugConfigurations && (p.type === debugType) && (p.scope === scope));
return providers.length > 0;
}
@@ -234,11 +241,43 @@ export class ConfigurationManager implements IConfigurationManager {
async provideDebugConfigurations(folderUri: uri | undefined, type: string, token: CancellationToken): Promise<any[]> {
await this.activateDebuggers('onDebugInitialConfigurations');
const results = await Promise.all(this.configProviders.filter(p => p.type === type && p.provideDebugConfigurations).map(p => p.provideDebugConfigurations!(folderUri, token)));
const results = await Promise.all(this.configProviders.filter(p => p.type === type && p.scope === DebugConfigurationProviderScope.Initial && p.provideDebugConfigurations).map(p => p.provideDebugConfigurations!(folderUri, token)));
return results.reduce((first, second) => first.concat(second), []);
}
async getDynamicProviders(): Promise<{ label: string, pick: () => Promise<{ launch: ILaunch, config: IConfig } | undefined> }[]> {
await this.activateDebuggers('onDebugDynamicConfigurations');
const dynamicProviders = this.configProviders.filter(p => p.scope === DebugConfigurationProviderScope.Dynamic && p.provideDebugConfigurations);
return dynamicProviders.map(provider => {
return {
label: this.getDebuggerLabel(provider.type)!,
pick: async () => {
const token = new CancellationTokenSource();
const picks: Promise<{ label: string, launch: ILaunch, config: IConfig }[]>[] = [];
this.getLaunches().forEach(launch => {
if (launch.workspace) {
picks.push(provider.provideDebugConfigurations!(launch.workspace.uri, token.token).then(configurations => configurations.map(config => ({
label: config.name,
config,
launch
}))));
}
});
const promiseOfPicks = Promise.all(picks).then(result => result.reduce((first, second) => first.concat(second), []));
const result = await this.quickInputService.pick<{ label: string, launch: ILaunch, config: IConfig }>(promiseOfPicks, { placeHolder: nls.localize('selectConfiguration', "Select Debug Configuration") });
if (!result) {
// User canceled quick input we should notify the provider to cancel computing configurations
token.cancel();
}
return result;
}
};
});
}
getAllConfigurations(): { launch: ILaunch; name: string; presentation?: IConfigPresentation }[] {
const all: { launch: ILaunch, name: string, presentation?: IConfigPresentation }[] = [];
for (let l of this.launches) {

View File

@@ -7,6 +7,7 @@ import * as nls from 'vs/nls';
import { RunOnceScheduler } from 'vs/base/common/async';
import * as env from 'vs/base/common/platform';
import { visit } from 'vs/base/common/json';
import { setProperty } from 'vs/base/common/jsonEdit';
import { Constants } from 'vs/base/common/uint';
import { KeyCode } from 'vs/base/common/keyCodes';
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
@@ -34,6 +35,8 @@ import { DebugHoverWidget } from 'vs/workbench/contrib/debug/browser/debugHover'
import { ITextModel } from 'vs/editor/common/model';
import { getHover } from 'vs/editor/contrib/hover/getHover';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { EditOperation } from 'vs/editor/common/core/editOperation';
import { basename } from 'vs/base/common/path';
const HOVER_DELAY = 300;
const LAUNCH_JSON_REGEX = /\.vscode\/launch\.json$/;
@@ -444,35 +447,54 @@ class DebugEditorContribution implements IDebugEditorContribution {
"debug/addLaunchConfiguration" : {}
*/
this.telemetryService.publicLog('debug/addLaunchConfiguration');
let configurationsArrayPosition: Position | undefined;
const model = this.editor.getModel();
if (!model) {
return;
}
let depthInArray = 0;
let configurationsArrayPosition: Position | undefined;
let lastProperty: string;
visit(model.getValue(), {
onObjectProperty: (property, offset, length) => {
lastProperty = property;
},
onArrayBegin: (offset: number, length: number) => {
if (lastProperty === 'configurations' && depthInArray === 0) {
configurationsArrayPosition = model.getPositionAt(offset + 1);
const getConfigurationPosition = () => {
let depthInArray = 0;
visit(model.getValue(), {
onObjectProperty: (property: string) => {
lastProperty = property;
},
onArrayBegin: (offset: number) => {
if (lastProperty === 'configurations' && depthInArray === 0) {
configurationsArrayPosition = model.getPositionAt(offset + 1);
}
depthInArray++;
},
onArrayEnd: () => {
depthInArray--;
}
depthInArray++;
},
onArrayEnd: () => {
depthInArray--;
}
});
});
};
this.editor.focus();
getConfigurationPosition();
if (!configurationsArrayPosition) {
// "configurations" array doesn't exist. Add it here.
const { tabSize, insertSpaces } = model.getOptions();
const eol = model.getEOL();
const edit = (basename(model.uri.fsPath) === 'launch.json') ?
setProperty(model.getValue(), ['configurations'], [], { tabSize, insertSpaces, eol })[0] :
setProperty(model.getValue(), ['launch'], { 'configurations': [] }, { tabSize, insertSpaces, eol })[0];
const startPosition = model.getPositionAt(edit.offset);
const lineNumber = startPosition.lineNumber;
const range = new Range(lineNumber, startPosition.column, lineNumber, model.getLineMaxColumn(lineNumber));
model.pushEditOperations(null, [EditOperation.replace(range, edit.content)], () => null);
// Go through the file again since we've edited it
getConfigurationPosition();
}
if (!configurationsArrayPosition) {
return;
}
this.editor.focus();
const insertLine = (position: Position): Promise<any> => {
// Check if there are more characters on a line after a "configurations": [, if yes enter a newline
if (model.getLineLastNonWhitespaceColumn(position.lineNumber) > position.column) {

View File

@@ -24,7 +24,7 @@ import { editorHoverBackground, editorHoverBorder, editorHoverForeground } from
import { ModelDecorationOptions } from 'vs/editor/common/model/textModel';
import { getExactExpressionStartAndEnd } from 'vs/workbench/contrib/debug/common/debugUtils';
import { AsyncDataTree } from 'vs/base/browser/ui/tree/asyncDataTree';
import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
import { WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
import { coalesce } from 'vs/base/common/arrays';
@@ -105,7 +105,6 @@ export class DebugHoverWidget implements IContentWidget {
this.tree = <WorkbenchAsyncDataTree<IExpression, IExpression, any>>this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'DebugHover', this.treeContainer, new DebugHoverDelegate(), [this.instantiationService.createInstance(VariablesRenderer)],
dataSource, {
ariaLabel: nls.localize('treeAriaLabel', "Debug Hover"),
accessibilityProvider: new DebugHoverAccessibilityProvider(),
mouseSupport: false,
horizontalScrolling: true,
@@ -335,7 +334,12 @@ export class DebugHoverWidget implements IContentWidget {
}
}
class DebugHoverAccessibilityProvider implements IAccessibilityProvider<IExpression> {
class DebugHoverAccessibilityProvider implements IListAccessibilityProvider<IExpression> {
getWidgetAriaLabel(): string {
return nls.localize('treeAriaLabel', "Debug Hover");
}
getAriaLabel(element: IExpression): string {
return nls.localize('variableAriaLabel', "{0} value {1}, variables, debug", element.name, element.value);
}

View File

@@ -17,10 +17,11 @@ export class DebugProgressContribution implements IWorkbenchContribution {
@IDebugService private readonly debugService: IDebugService,
@IProgressService private readonly progressService: IProgressService
) {
let progressListener: IDisposable;
const onFocusSession = (session: IDebugSession | undefined) => {
let progressListener: IDisposable | undefined;
const listenOnProgress = (session: IDebugSession | undefined) => {
if (progressListener) {
progressListener.dispose();
progressListener = undefined;
}
if (session) {
progressListener = session.onDidProgressStart(async progressStartEvent => {
@@ -34,7 +35,7 @@ export class DebugProgressContribution implements IWorkbenchContribution {
});
this.progressService.withProgress({ location: VIEWLET_ID }, () => promise);
const source = this.debugService.getConfigurationManager().getDebuggerLabel(session);
const source = this.debugService.getConfigurationManager().getDebuggerLabel(session.configuration.type);
this.progressService.withProgress({
location: ProgressLocation.Notification,
title: progressStartEvent.body.title,
@@ -71,8 +72,13 @@ export class DebugProgressContribution implements IWorkbenchContribution {
});
}
};
this.toDispose.push(this.debugService.getViewModel().onDidFocusSession(onFocusSession));
onFocusSession(this.debugService.getViewModel().focusedSession);
this.toDispose.push(this.debugService.getViewModel().onDidFocusSession(listenOnProgress));
listenOnProgress(this.debugService.getViewModel().focusedSession);
this.toDispose.push(this.debugService.onWillNewSession(session => {
if (!progressListener) {
listenOnProgress(session);
}
}));
}
dispose(): void {

View File

@@ -13,6 +13,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands';
import { matchesFuzzy } from 'vs/base/common/filters';
import { StartAction } from 'vs/workbench/contrib/debug/browser/debugActions';
import { withNullAsUndefined } from 'vs/base/common/types';
import { ADD_CONFIGURATION_ID } from 'vs/workbench/contrib/debug/browser/debugCommands';
export class StartDebugQuickAccessProvider extends PickerQuickAccessProvider<IPickerQuickAccessItem> {
@@ -22,7 +23,7 @@ export class StartDebugQuickAccessProvider extends PickerQuickAccessProvider<IPi
@IDebugService private readonly debugService: IDebugService,
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
@ICommandService private readonly commandService: ICommandService,
@INotificationService private readonly notificationService: INotificationService
@INotificationService private readonly notificationService: INotificationService,
) {
super(StartDebugQuickAccessProvider.PREFIX, {
noResultsPick: {
@@ -31,8 +32,9 @@ export class StartDebugQuickAccessProvider extends PickerQuickAccessProvider<IPi
});
}
protected getPicks(filter: string): (IQuickPickSeparator | IPickerQuickAccessItem)[] {
protected async getPicks(filter: string): Promise<(IQuickPickSeparator | IPickerQuickAccessItem)[]> {
const picks: Array<IPickerQuickAccessItem | IQuickPickSeparator> = [];
picks.push({ type: 'separator', label: 'launch.json' });
const configManager = this.debugService.getConfigurationManager();
@@ -76,12 +78,32 @@ export class StartDebugQuickAccessProvider extends PickerQuickAccessProvider<IPi
}
}
// Entries detected configurations
const dynamicProviders = await configManager.getDynamicProviders();
if (dynamicProviders.length > 0) {
picks.push({ type: 'separator', label: localize('contributed', "contributed") });
}
dynamicProviders.forEach(provider => {
picks.push({
label: `$(folder) ${provider.label}...`,
ariaLabel: localize('providerAriaLabel', "{0} contributed configurations", provider.label),
accept: async () => {
const pick = await provider.pick();
if (pick) {
this.debugService.startDebugging(pick.launch, pick.config);
}
}
});
});
// Entries: launches
const visibleLaunches = configManager.getLaunches().filter(launch => !launch.hidden);
// Separator
if (visibleLaunches.length > 0) {
picks.push({ type: 'separator' });
picks.push({ type: 'separator', label: localize('configure', "configure") });
}
for (const launch of visibleLaunches) {
@@ -94,7 +116,7 @@ export class StartDebugQuickAccessProvider extends PickerQuickAccessProvider<IPi
label,
description: this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE ? launch.name : '',
highlights: { label: withNullAsUndefined(matchesFuzzy(filter, label, true)) },
accept: () => this.commandService.executeCommand('debug.addConfiguration', launch.uri.toString())
accept: () => this.commandService.executeCommand(ADD_CONFIGURATION_ID, launch.uri.toString())
});
}

View File

@@ -584,7 +584,8 @@ export class DebugService implements IDebugService {
const focusedSession = this.viewModel.focusedSession;
if (focusedSession && focusedSession.getId() === session.getId()) {
await this.focusStackFrame(undefined);
const { session } = getStackFrameThreadAndSessionToFocus(this.model, undefined);
this.viewModel.setFocus(undefined, undefined, session, false);
}
if (this.model.getSessions().length === 0) {

View File

@@ -61,11 +61,12 @@ export class DebugStatusContribution implements IWorkbenchContribution {
const name = manager.selectedConfiguration.name || '';
const nameAndLaunchPresent = name && manager.selectedConfiguration.launch;
if (nameAndLaunchPresent) {
text = '$(play) ' + (manager.getLaunches().length > 1 ? `${name} (${manager.selectedConfiguration.launch!.name})` : name);
text = (manager.getLaunches().length > 1 ? `${name} (${manager.selectedConfiguration.launch!.name})` : name);
}
return {
text: text,
text: '$(play) ' + text,
ariaLabel: nls.localize('debugTarget', "Debug: {0}", text),
tooltip: nls.localize('selectAndStartDebug', "Select and start debug configuration"),
command: 'workbench.action.debug.selectandstart'
};

View File

@@ -62,7 +62,7 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
@INotificationService private readonly notificationService: INotificationService,
@IViewDescriptorService viewDescriptorService: IViewDescriptorService
) {
super(VIEWLET_ID, `${VIEWLET_ID}.state`, { mergeViewWithContainerWhenSingleView: true }, instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService);
super(VIEWLET_ID, { mergeViewWithContainerWhenSingleView: true }, instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService);
this._register(this.debugService.onDidChangeState(state => this.onDebugServiceStateChange(state)));
this._register(this.debugService.onDidNewSession(() => this.updateToolBar()));

View File

@@ -12,7 +12,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { IRemotePathService } from 'vs/workbench/services/path/common/remotePathService';
import { IPathService } from 'vs/workbench/services/path/common/pathService';
const CONTROL_CODES = '\\u0000-\\u0020\\u007f-\\u009f';
const WEB_LINK_REGEX = new RegExp('(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|data:|www\\.)[^\\s' + CONTROL_CODES + '"]{2,}[^\\s' + CONTROL_CODES + '"\')}\\],:;.!?]', 'ug');
@@ -38,7 +38,7 @@ export class LinkDetector {
@IEditorService private readonly editorService: IEditorService,
@IFileService private readonly fileService: IFileService,
@IOpenerService private readonly openerService: IOpenerService,
@IRemotePathService private readonly remotePathService: IRemotePathService,
@IPathService private readonly pathService: IPathService,
@IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService
) {
// noop
@@ -120,7 +120,7 @@ export class LinkDetector {
}
if (path[0] === '~') {
const userHome = this.remotePathService.userHomeSync;
const userHome = this.pathService.resolvedUserHome;
if (userHome) {
path = osPath.join(userHome.fsPath, path.substring(1));
}

View File

@@ -26,9 +26,9 @@ import { ResourceLabels, IResourceLabelProps, IResourceLabelOptions, IResourceLa
import { FileKind } from 'vs/platform/files/common/files';
import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
import { ITreeNode, ITreeFilter, TreeVisibility, TreeFilterResult, ITreeElement } from 'vs/base/browser/ui/tree/tree';
import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ResourceNavigator, WorkbenchCompressibleObjectTree } from 'vs/platform/list/browser/listService';
import { TreeResourceNavigator, WorkbenchCompressibleObjectTree } from 'vs/platform/list/browser/listService';
import { dispose } from 'vs/base/common/lifecycle';
import { createMatches, FuzzyScore } from 'vs/base/common/filters';
import { DebugContentProvider } from 'vs/workbench/contrib/debug/common/debugContentProvider';
@@ -39,7 +39,7 @@ import { IViewDescriptorService } from 'vs/workbench/common/views';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IRemotePathService } from 'vs/workbench/services/path/common/remotePathService';
import { IPathService } from 'vs/workbench/services/path/common/pathService';
const NEW_STYLE_COMPRESS = true;
@@ -241,12 +241,12 @@ class RootFolderTreeItem extends BaseTreeItem {
class RootTreeItem extends BaseTreeItem {
constructor(private _remotePathService: IRemotePathService, private _contextService: IWorkspaceContextService, private _labelService: ILabelService) {
constructor(private _pathService: IPathService, private _contextService: IWorkspaceContextService, private _labelService: ILabelService) {
super(undefined, 'Root');
}
add(session: IDebugSession): SessionTreeItem {
return this.createIfNeeded(session.getId(), () => new SessionTreeItem(this._labelService, this, session, this._remotePathService, this._contextService));
return this.createIfNeeded(session.getId(), () => new SessionTreeItem(this._labelService, this, session, this._pathService, this._contextService));
}
find(session: IDebugSession): SessionTreeItem {
@@ -262,7 +262,7 @@ class SessionTreeItem extends BaseTreeItem {
private _map = new Map<string, BaseTreeItem>();
private _labelService: ILabelService;
constructor(labelService: ILabelService, parent: BaseTreeItem, session: IDebugSession, private _remotePathService: IRemotePathService, private rootProvider: IWorkspaceContextService) {
constructor(labelService: ILabelService, parent: BaseTreeItem, session: IDebugSession, private _pathService: IPathService, private rootProvider: IWorkspaceContextService) {
super(parent, session.getLabel(), true);
this._labelService = labelService;
this._session = session;
@@ -347,7 +347,7 @@ class SessionTreeItem extends BaseTreeItem {
} else {
// on unix try to tildify absolute paths
path = normalize(path);
const userHome = this._remotePathService.userHomeSync;
const userHome = this._pathService.resolvedUserHome;
if (userHome && !isWindows) {
path = tildify(path, userHome.fsPath);
}
@@ -426,7 +426,7 @@ export class LoadedScriptsView extends ViewPane {
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
@IDebugService private readonly debugService: IDebugService,
@ILabelService private readonly labelService: ILabelService,
@IRemotePathService private readonly remotePathService: IRemotePathService,
@IPathService private readonly pathService: IPathService,
@IOpenerService openerService: IOpenerService,
@IThemeService themeService: IThemeService,
@ITelemetryService telemetryService: ITelemetryService,
@@ -446,7 +446,7 @@ export class LoadedScriptsView extends ViewPane {
this.filter = new LoadedScriptsFilter();
const root = new RootTreeItem(this.remotePathService, this.contextService, this.labelService);
const root = new RootTreeItem(this.pathService, this.contextService, this.labelService);
this.treeLabels = this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this.onDidChangeBodyVisibility });
this._register(this.treeLabels);
@@ -473,7 +473,6 @@ export class LoadedScriptsView extends ViewPane {
},
filter: this.filter,
accessibilityProvider: new LoadedSciptsAccessibilityProvider(),
ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'loadedScriptsAriaLabel' }, "Debug Loaded Scripts"),
overrideStyles: {
listBackground: this.getBackgroundColor()
}
@@ -492,7 +491,7 @@ export class LoadedScriptsView extends ViewPane {
}, 300);
this._register(this.changeScheduler);
const loadedScriptsNavigator = ResourceNavigator.createTreeResourceNavigator(this.tree);
const loadedScriptsNavigator = new TreeResourceNavigator(this.tree);
this._register(loadedScriptsNavigator);
this._register(loadedScriptsNavigator.onDidOpenResource(e => {
if (e.element instanceof BaseTreeItem) {
@@ -611,6 +610,7 @@ export class LoadedScriptsView extends ViewPane {
}
layoutBody(height: number, width: number): void {
super.layoutBody(height, width);
this.tree.layout(height, width);
}
@@ -708,7 +708,11 @@ class LoadedScriptsRenderer implements ICompressibleTreeRenderer<BaseTreeItem, F
}
}
class LoadedSciptsAccessibilityProvider implements IAccessibilityProvider<LoadedScriptsItem> {
class LoadedSciptsAccessibilityProvider implements IListAccessibilityProvider<LoadedScriptsItem> {
getWidgetAriaLabel(): string {
return nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'loadedScriptsAriaLabel' }, "Debug Loaded Scripts");
}
getAriaLabel(element: LoadedScriptsItem): string {

View File

@@ -109,85 +109,10 @@
color: inherit;
}
.monaco-workbench .monaco-list-row .expression .name {
color: #9b46b0;
}
.monaco-workbench .monaco-list-row .expression .name.virtual {
opacity: 0.5;
}
.monaco-workbench > .monaco-list-row .expression .value {
color: rgba(108, 108, 108, 0.8);
}
.monaco-workbench .monaco-list-row .expression .unavailable {
font-style: italic;
}
.monaco-workbench .monaco-list-row .expression .error,
.monaco-workbench .debug-pane .debug-variables .scope .error {
color: #e51400;
}
.monaco-workbench .monaco-list-row .expression .value.number {
color: #098658;
}
.monaco-workbench .monaco-list-row .expression .value.boolean {
color: #0000ff;
}
.monaco-workbench .monaco-list-row .expression .value.string {
color: #a31515;
}
.vs-dark .monaco-workbench > .monaco-list-row .expression .value {
color: rgba(204, 204, 204, 0.6);
}
.vs-dark .monaco-workbench .monaco-list-row .expression .error,
.vs-dark .monaco-workbench .debug-pane .debug-variables .scope .error {
color: #f48771;
}
.vs-dark .monaco-workbench .monaco-list-row .expression .value.number {
color: #b5cea8;
}
.hc-black .monaco-workbench .monaco-list-row .expression .value.number {
color: #89d185;
}
.hc-black .monaco-workbench .monaco-list-row .expression .value.boolean {
color: #75bdfe;
}
.hc-black .monaco-workbench .monaco-list-row .expression .value.string {
color: #f48771;
}
.vs-dark .monaco-workbench .monaco-list-row .expression .value.boolean {
color: #4e94ce;
}
.vs-dark .monaco-workbench .monaco-list-row .expression .value.string {
color: #ce9178;
}
.hc-black .monaco-workbench .monaco-list-row .expression .error,
.hc-black .monaco-workbench .debug-pane .debug-variables .scope .error {
color: #f48771;
}
/* Dark theme */
.vs-dark .monaco-workbench .monaco-list-row .expression .name {
color: #c586c0;
}
/* High Contrast Theming */
.hc-black .monaco-workbench .monaco-list-row .expression .name {
color: inherit;
}

View File

@@ -64,49 +64,6 @@
padding: 4px 5px;
}
.monaco-editor .debug-hover-widget .error {
color: #E51400;
}
.monaco-editor .debug-hover-widget .value.number {
color: #098658;
}
.monaco-editor .debug-hover-widget .value.boolean {
color: #0000FF;
}
.monaco-editor .debug-hover-widget .value.string {
color: #A31515;
}
/* Dark theme */
.monaco-editor.vs-dark .debug-hover-widget .value,
.monaco-editor.hc-black .debug-hover-widget .value {
color: rgba(204, 204, 204, 0.6);
}
.monaco-editor.vs-dark .debug-hover-widget .error,
.monaco-editor.hc-black .debug-hover-widget .error {
color: #F48771;
}
.monaco-editor.vs-dark .debug-hover-widget .value.number,
.monaco-editor.hc-black .debug-hover-widget .value.number {
color: #B5CEA8;
}
.monaco-editor.vs-dark .debug-hover-widget .value.boolean,
.monaco-editor.hc-black .debug-hover-widget .value.boolean {
color: #4E94CE;
}
.monaco-editor.vs-dark .debug-hover-widget .value.string,
.monaco-editor.hc-black .debug-hover-widget .value.string {
color: #CE9178;
}
.monaco-editor.vs-dark .debugHoverHighlight,
.monaco-editor.hc-theme .debugHoverHighlight {
background-color: rgba(38, 79, 120, 0.25);

View File

@@ -48,6 +48,7 @@
border: none;
margin-top: 0px;
cursor: pointer;
outline-offset: 2px;
}
.monaco-workbench .monaco-action-bar .start-debug-action-item .configuration.disabled .monaco-select-box {
@@ -63,24 +64,12 @@
/* Debug viewlet trees */
.debug-pane .line-number {
background: rgba(136, 136, 136, 0.3);
border-radius: 2px;
font-size: 0.9em;
padding: 0 3px;
line-height: 20px;
}
.debug-pane .monaco-list-row.selected .line-number,
.debug-pane .monaco-list-row.selected .thread > .state > .label,
.debug-pane .monaco-list-row.selected .session > .state > .label {
background-color: #ffffff;
color: #666;
}
.debug-pane .monaco-list:focus .monaco-list-row.selected.focused .codicon {
color: inherit !important;
}
.debug-pane .disabled {
opacity: 0.65;
cursor: initial;
@@ -108,21 +97,6 @@
font-size: 9px;
}
.debug-pane .debug-call-stack-title > .pause-message > .label.exception {
background-color: #A31515;
color: rgb(255, 255, 255);
}
.vs-dark .debug-pane .debug-call-stack-title > .pause-message > .label.exception {
background-color: #6C2022;
color: inherit;
}
.hc-black .debug-pane .debug-call-stack-title > .pause-message > .label.exception {
background-color: #6C2022;
color: inherit;
}
.debug-pane .debug-call-stack .thread,
.debug-pane .debug-call-stack .session {
display: flex;
@@ -176,7 +150,6 @@
.debug-pane .debug-call-stack .thread > .state > .label,
.debug-pane .debug-call-stack .session > .state > .label {
background: rgba(136, 136, 136, 0.3);
border-radius: 2px;
font-size: 0.8em;
padding: 0 3px;
@@ -220,20 +193,12 @@
display: none;
}
.debug-pane .debug-call-stack .monaco-list-row:not(.selected) .stack-frame > .file {
color: rgba(108, 108, 108, 0.8);
}
.debug-pane .debug-call-stack .stack-frame > .file > .file-name {
overflow: hidden;
text-overflow: ellipsis;
margin-right: 0.8em;
}
.vs-dark .debug-pane .debug-call-stack .monaco-list-row:not(.selected) .stack-frame > .file {
color: rgba(204, 204, 204, 0.6);
}
.debug-pane .debug-call-stack .stack-frame > .file:not(:first-child) {
margin-left: 0.8em;
}
@@ -243,7 +208,7 @@
}
.debug-pane .debug-call-stack .show-more {
opacity: 0.35;
opacity: 0.5;
text-align: center;
}
@@ -253,10 +218,6 @@
overflow: hidden;
}
.debug-pane .debug-call-stack .monaco-list:focus .monaco-list-row.selected .codicon {
color: inherit !important;
}
/* Variables & Expression view */
.debug-pane .scope {
@@ -264,27 +225,10 @@
font-size: 11px;
}
/* Animation of changed values in Debug viewlet */
@keyframes debugViewletValueChanged {
0% { background-color: rgba(86, 156, 214, 0) }
5% { background-color: rgba(86, 156, 214, .75) }
100% { background-color: rgba(86, 156, 214, .3) }
}
@keyframes debugViewletValueChangedDark {
0% { background-color: rgba(86, 156, 214, 0) }
5% { background-color: rgba(86, 156, 214, .5) }
100% { background-color: rgba(86, 156, 214, .2) }
}
.debug-pane .monaco-list-row .expression .value.changed {
padding: 2px;
margin: 4px;
border-radius: 4px;
background-color: rgba(86, 156, 214, .5);
animation-name: debugViewletValueChanged;
animation-duration: .75s;
animation-fill-mode: forwards;
}
.debug-pane .monaco-inputbox {
@@ -318,10 +262,6 @@
flex : 1;
}
.vs-dark .debug-pane .monaco-list-row .expression .value.changed {
animation-name: debugViewletValueChanged;
}
.debug-pane .debug-variables .scope .error {
font-style: italic;
text-overflow: ellipsis;

View File

@@ -81,7 +81,6 @@
.repl .repl-input-wrapper {
display: flex;
align-items: center;
border-top: 1px solid rgba(128, 128, 128, 0.35);
}
/* Only show 'stale expansion' info when the element gets expanded. */
@@ -89,10 +88,6 @@
content: '';
}
.hc-black .repl .repl-input-wrapper {
border-top-color: #6FC3DF;
}
.repl .repl-input-wrapper .repl-input-chevron {
padding: 0 6px 0 8px;
width: 16px;
@@ -108,18 +103,6 @@
font-style: italic;
}
.vs .repl .repl-tree .output.expression > .warn {
color: #cd9731;
}
.vs-dark .repl .repl-tree .output.expression > .warn {
color: #cd9731;
}
.hc-black .repl .repl-tree .output.expression > .warn {
color: #008000;
}
.vs .repl .repl-tree .output.expression > .annotation {
color: #007ACC;
}
@@ -132,6 +115,18 @@
color: #0000FF;
}
.vs .repl .repl-tree .output.expression > .warn {
color: #cd9731;
}
.vs-dark .repl .repl-tree .output.expression > .warn {
color: #cd9731;
}
.hc-black .repl .repl-tree .output.expression > .warn {
color: #008000;
}
/* ANSI Codes */
.monaco-workbench .repl .repl-tree .output.expression .code-bold { font-weight: bold; }
.monaco-workbench .repl .repl-tree .output.expression .code-italic { font-style: italic; }

View File

@@ -706,7 +706,7 @@ export class RawDebugSession implements IDisposable {
The message is sent in the name of the adapter but the adapter doesn't know about it.
However, since adapters are an open-ended set, we can not declared the events statically either.
*/
this.customTelemetryService.publicLog('debugProtocolErrorResponse', { error: telemetryMessage });
this.customTelemetryService.publicLog('debugProtocolErrorResponse', { error: telemetryMessage }, true);
}
}

View File

@@ -5,6 +5,7 @@
import 'vs/css!./media/repl';
import { URI as uri } from 'vs/base/common/uri';
import { Color } from 'vs/base/common/color';
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';
@@ -20,7 +21,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { ICodeEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';
import { memoize } from 'vs/base/common/decorators';
import { dispose, IDisposable, Disposable } from 'vs/base/common/lifecycle';
@@ -33,7 +34,7 @@ import { createAndBindHistoryNavigationWidgetScopedContextKeyService } from 'vs/
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { getSimpleEditorOptions, getSimpleCodeEditorWidgetOptions } from 'vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
import { IDecorationOptions } from 'vs/editor/common/editorCommon';
import { transparent, editorForeground } from 'vs/platform/theme/common/colorRegistry';
import { transparent, editorForeground, inputBorder } from 'vs/platform/theme/common/colorRegistry';
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
import { FocusSessionActionViewItem } from 'vs/workbench/contrib/debug/browser/debugActionViewItems';
import { CompletionContext, CompletionList, CompletionProviderRegistry, CompletionItem, completionKindFromString, CompletionItemKind, CompletionItemInsertTextRule } from 'vs/editor/common/modes';
@@ -411,6 +412,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
}
protected layoutBody(height: number, width: number): void {
super.layoutBody(height, width);
this.dimension = new dom.Dimension(width, height);
const replInputHeight = Math.min(this.replInput.getContentHeight(), height);
if (this.tree) {
@@ -529,7 +531,6 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
// https://github.com/microsoft/TypeScript/issues/32526
new ReplDataSource() as IAsyncDataSource<IDebugSession, IReplElement>,
{
ariaLabel: localize('replAriaLabel', "Read Eval Print Loop Panel"),
accessibilityProvider: new ReplAccessibilityProvider(),
identityProvider: { getId: (element: IReplElement) => element.getId() },
mouseSupport: false,
@@ -811,3 +812,13 @@ export class ClearReplAction extends Action {
function getReplView(viewsService: IViewsService): Repl | undefined {
return viewsService.getActiveViewWithId(REPL_VIEW_ID) as Repl ?? undefined;
}
registerThemingParticipant((theme, collector) => {
const inputBorderColor = theme.getColor(inputBorder) || Color.fromHex('#80808060');
collector.addRule(`
.repl .repl-input-wrapper {
border-top: 1px solid ${inputBorderColor};
}
`);
});

View File

@@ -5,7 +5,7 @@
import severity from 'vs/base/common/severity';
import * as dom from 'vs/base/browser/dom';
import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { Variable } from 'vs/workbench/contrib/debug/common/debugModel';
import { SimpleReplElement, RawObjectReplElement, ReplEvaluationInput, ReplEvaluationResult, ReplGroup } from 'vs/workbench/contrib/debug/common/replModel';
import { CachedListVirtualDelegate } from 'vs/base/browser/ui/list/list';
@@ -23,6 +23,7 @@ import { IReplElementSource, IDebugService, IExpression, IReplElement, IDebugCon
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { localize } from 'vs/nls';
import { Codicon } from 'vs/base/common/codicons';
const $ = dom.$;
@@ -128,7 +129,7 @@ export class ReplEvaluationResultsRenderer implements ITreeRenderer<ReplEvaluati
linkDetector: this.linkDetector
});
if (expression.hasChildren) {
templateData.annotation.className = 'annotation codicon codicon-info';
templateData.annotation.className = 'annotation ' + Codicon.info.classNames;
templateData.annotation.title = localize('stateCapture', "Object state is captured from first evaluation");
}
}
@@ -262,7 +263,7 @@ export class ReplRawObjectsRenderer implements ITreeRenderer<RawObjectReplElemen
// annotation if any
if (element.annotation) {
templateData.annotation.className = 'annotation codicon codicon-info';
templateData.annotation.className = 'annotation ' + Codicon.info.classNames;
templateData.annotation.title = element.annotation;
} else {
templateData.annotation.className = '';
@@ -365,7 +366,12 @@ export class ReplDataSource implements IAsyncDataSource<IDebugSession, IReplElem
}
}
export class ReplAccessibilityProvider implements IAccessibilityProvider<IReplElement> {
export class ReplAccessibilityProvider implements IListAccessibilityProvider<IReplElement> {
getWidgetAriaLabel(): string {
return localize('debugConsole', "Debug Console");
}
getAriaLabel(element: IReplElement): string {
if (element instanceof Variable) {
return localize('replVariableAriaLabel', "Variable {0} has value {1}, read eval print loop, debug", element.name, element.value);

View File

@@ -18,7 +18,7 @@ import { CopyValueAction } from 'vs/workbench/contrib/debug/browser/debugActions
import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ViewPane } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
import { ITreeRenderer, ITreeNode, ITreeMouseEvent, ITreeContextMenuEvent, IAsyncDataSource } from 'vs/base/browser/ui/tree/tree';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -102,7 +102,6 @@ export class VariablesView extends ViewPane {
this.tree = <WorkbenchAsyncDataTree<IViewModel | IExpression | IScope, IExpression | IScope, FuzzyScore>>this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'VariablesView', treeContainer, new VariablesDelegate(),
[this.instantiationService.createInstance(VariablesRenderer), new ScopesRenderer(), new ScopeErrorRenderer()],
new VariablesDataSource(), {
ariaLabel: nls.localize('variablesAriaTreeLabel', "Debug Variables"),
accessibilityProvider: new VariablesAccessibilityProvider(),
identityProvider: { getId: (element: IExpression | IScope) => element.getId() },
keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e: IExpression | IScope) => e },
@@ -152,10 +151,11 @@ export class VariablesView extends ViewPane {
}
getActions(): IAction[] {
return [new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all')];
return [new CollapseAction(() => this.tree, true, 'explorer-action codicon-collapse-all')];
}
layoutBody(width: number, height: number): void {
super.layoutBody(height, width);
this.tree.layout(width, height);
}
@@ -348,7 +348,12 @@ export class VariablesRenderer extends AbstractExpressionsRenderer {
}
}
class VariablesAccessibilityProvider implements IAccessibilityProvider<IExpression | IScope> {
class VariablesAccessibilityProvider implements IListAccessibilityProvider<IExpression | IScope> {
getWidgetAriaLabel(): string {
return nls.localize('variablesAriaTreeLabel', "Debug Variables");
}
getAriaLabel(element: IExpression | IScope): string | null {
if (element instanceof Scope) {
return nls.localize('variableScopeAriaLabel', "Scope {0}, variables, debug", element.name);

View File

@@ -20,7 +20,7 @@ import { renderExpressionValue, renderViewTree, IInputBoxOptions, AbstractExpres
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ViewPane } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
import { WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
import { IAsyncDataSource, ITreeMouseEvent, ITreeContextMenuEvent, ITreeDragAndDrop, ITreeDragOverReaction } from 'vs/base/browser/ui/tree/tree';
import { IDragAndDropData } from 'vs/base/browser/dnd';
@@ -76,7 +76,6 @@ export class WatchExpressionsView extends ViewPane {
const expressionsRenderer = this.instantiationService.createInstance(WatchExpressionsRenderer);
this.tree = <WorkbenchAsyncDataTree<IDebugService | IExpression, IExpression, FuzzyScore>>this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'WatchExpressions', treeContainer, new WatchExpressionsDelegate(), [expressionsRenderer, this.instantiationService.createInstance(VariablesRenderer)],
new WatchExpressionsDataSource(), {
ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'watchAriaTreeLabel' }, "Debug Watch Expressions"),
accessibilityProvider: new WatchExpressionsAccessibilityProvider(),
identityProvider: { getId: (element: IExpression) => element.getId() },
keyboardNavigationLabelProvider: {
@@ -94,7 +93,6 @@ export class WatchExpressionsView extends ViewPane {
listBackground: this.getBackgroundColor()
}
});
this.tree.setInput(this.debugService);
CONTEXT_WATCH_EXPRESSIONS_FOCUSED.bindTo(this.tree.contextKeyService);
@@ -144,6 +142,7 @@ export class WatchExpressionsView extends ViewPane {
}
layoutBody(height: number, width: number): void {
super.layoutBody(height, width);
this.tree.layout(height, width);
}
@@ -154,7 +153,7 @@ export class WatchExpressionsView extends ViewPane {
getActions(): IAction[] {
return [
new AddWatchExpressionAction(AddWatchExpressionAction.ID, AddWatchExpressionAction.LABEL, this.debugService, this.keybindingService),
new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all'),
new CollapseAction(() => this.tree, true, 'explorer-action codicon-collapse-all'),
new RemoveAllWatchExpressionsAction(RemoveAllWatchExpressionsAction.ID, RemoveAllWatchExpressionsAction.LABEL, this.debugService, this.keybindingService)
];
}
@@ -296,7 +295,12 @@ export class WatchExpressionsRenderer extends AbstractExpressionsRenderer {
}
}
class WatchExpressionsAccessibilityProvider implements IAccessibilityProvider<IExpression> {
class WatchExpressionsAccessibilityProvider implements IListAccessibilityProvider<IExpression> {
getWidgetAriaLabel(): string {
return nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'watchAriaTreeLabel' }, "Debug Watch Expressions");
}
getAriaLabel(element: IExpression): string {
if (element instanceof Expression) {
return nls.localize('watchExpressionAriaLabel', "{0} value {1}, watch, debug", (<Expression>element).name, (<Expression>element).value);

View File

@@ -24,6 +24,7 @@ import { isMacintosh } from 'vs/base/common/platform';
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { DisposableStore } from 'vs/base/common/lifecycle';
const debugStartLanguageKey = 'debugStartLanguage';
const CONTEXT_DEBUG_START_LANGUAGE = new RawContextKey<string>(debugStartLanguageKey, undefined);
@@ -73,7 +74,20 @@ export class WelcomeView extends ViewPane {
}
this.debuggerInterestedContext.set(false);
};
this._register(editorService.onDidActiveEditorChange(setContextKey));
const disposables = new DisposableStore();
this._register(disposables);
this._register(editorService.onDidActiveEditorChange(() => {
disposables.clear();
const editorControl = this.editorService.activeTextEditorControl;
if (isCodeEditor(editorControl)) {
disposables.add(editorControl.onDidChangeModelLanguage(setContextKey));
}
setContextKey();
}));
this._register(this.debugService.getConfigurationManager().onDidRegisterDebugger(setContextKey));
this._register(this.onDidChangeBodyVisibility(visible => {
if (visible) {

View File

@@ -23,6 +23,7 @@ import { TaskIdentifier } from 'vs/workbench/contrib/tasks/common/tasks';
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { CancellationToken } from 'vs/base/common/cancellation';
import { DebugConfigurationProviderScope } from 'vs/workbench/api/common/extHostTypes';
export const VIEWLET_ID = 'workbench.view.debug';
@@ -602,6 +603,7 @@ export interface IDebuggerContribution extends IPlatformSpecificAdapterContribut
export interface IDebugConfigurationProvider {
readonly type: string;
readonly scope: DebugConfigurationProviderScope;
resolveDebugConfiguration?(folderUri: uri | undefined, debugConfiguration: IConfig, token: CancellationToken): Promise<IConfig | null | undefined>;
resolveDebugConfigurationWithSubstitutedVariables?(folderUri: uri | undefined, debugConfiguration: IConfig, token: CancellationToken): Promise<IConfig | null | undefined>;
provideDebugConfigurations?(folderUri: uri | undefined, token: CancellationToken): Promise<IConfig[]>;
@@ -654,6 +656,7 @@ export interface IConfigurationManager {
isDebuggerInterestedInLanguage(language: string): boolean;
hasDebugConfigurationProvider(debugType: string): boolean;
getDynamicProviders(): Promise<{ label: string, pick: () => Promise<{ launch: ILaunch, config: IConfig } | undefined> }[]>;
registerDebugConfigurationProvider(debugConfigurationProvider: IDebugConfigurationProvider): IDisposable;
unregisterDebugConfigurationProvider(debugConfigurationProvider: IDebugConfigurationProvider): void;
@@ -663,7 +666,7 @@ export interface IConfigurationManager {
resolveConfigurationByProviders(folderUri: uri | undefined, type: string | undefined, debugConfiguration: any, token: CancellationToken): Promise<any>;
getDebugAdapterDescriptor(session: IDebugSession): Promise<IAdapterDescriptor | undefined>;
getDebuggerLabel(session: IDebugSession): string | undefined;
getDebuggerLabel(type: string): string | undefined;
registerDebugAdapterFactory(debugTypes: string[], debugAdapterFactory: IDebugAdapterFactory): IDisposable;
createDebugAdapter(session: IDebugSession): IDebugAdapter | undefined;

View File

@@ -24,7 +24,7 @@ export function formatPII(value: string, excludePII: boolean, args: { [key: stri
}
export function isSessionAttach(session: IDebugSession): boolean {
return !session.parentSession && session.configuration.request === 'attach' && !getExtensionHostDebugSession(session);
return session.configuration.request === 'attach' && !getExtensionHostDebugSession(session);
}
/**