mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 1fbacccbc900bb59ba8a8f26a4128d48a1c97842
This commit is contained in:
@@ -31,10 +31,10 @@ import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/
|
||||
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { Gesture } from 'vs/base/browser/touch';
|
||||
import { IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { TextEditorSelectionRevealType } from 'vs/platform/editor/common/editor';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
@@ -64,20 +64,23 @@ export class BreakpointsView extends ViewPane {
|
||||
@IDebugService private readonly debugService: IDebugService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IThemeService private readonly themeService: IThemeService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IContextViewService private readonly contextViewService: IContextViewService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
) {
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('breakpointsSection', "Breakpoints Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService);
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('breakpointsSection', "Breakpoints Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
|
||||
|
||||
this.minimumBodySize = this.maximumBodySize = getExpandedBodySize(this.debugService.getModel());
|
||||
this._register(this.debugService.getModel().onDidChangeBreakpoints(() => this.onBreakpointsChange()));
|
||||
}
|
||||
|
||||
public renderBody(container: HTMLElement): void {
|
||||
super.renderBody(container);
|
||||
|
||||
dom.addClass(container, 'debug-breakpoints');
|
||||
const delegate = new BreakpointsDelegate(this.debugService);
|
||||
|
||||
@@ -98,7 +101,7 @@ export class BreakpointsView extends ViewPane {
|
||||
isChecked: (breakpoint: IEnablement) => breakpoint.enabled
|
||||
},
|
||||
overrideStyles: {
|
||||
listBackground: SIDE_BAR_BACKGROUND
|
||||
listBackground: this.getBackgroundColor()
|
||||
}
|
||||
});
|
||||
|
||||
@@ -150,6 +153,12 @@ export class BreakpointsView extends ViewPane {
|
||||
this.onBreakpointsChange();
|
||||
}
|
||||
}));
|
||||
|
||||
this._register(this.viewDescriptorService.onDidChangeLocation(({ views, from, to }) => {
|
||||
if (views.some(v => v.id === this.id)) {
|
||||
this.list.updateOptions({ overrideStyles: { listBackground: this.getBackgroundColor() } });
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public focus(): void {
|
||||
|
||||
@@ -34,8 +34,9 @@ import { isSessionAttach } from 'vs/workbench/contrib/debug/common/debugUtils';
|
||||
import { STOP_ID, STOP_LABEL, DISCONNECT_ID, DISCONNECT_LABEL, RESTART_SESSION_ID, RESTART_LABEL, STEP_OVER_ID, STEP_OVER_LABEL, STEP_INTO_LABEL, STEP_INTO_ID, STEP_OUT_LABEL, STEP_OUT_ID, PAUSE_ID, PAUSE_LABEL, CONTINUE_ID, CONTINUE_LABEL } from 'vs/workbench/contrib/debug/browser/debugCommands';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { CollapseAction } from 'vs/workbench/browser/viewlet';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
@@ -98,8 +99,10 @@ export class CallStackView extends ViewPane {
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IMenuService menuService: IMenuService,
|
||||
@IContextKeyService readonly contextKeyService: IContextKeyService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
) {
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('callstackSection', "Call Stack Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService);
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('callstackSection', "Call Stack Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
|
||||
this.callStackItemType = CONTEXT_CALLSTACK_ITEM_TYPE.bindTo(contextKeyService);
|
||||
|
||||
this.contributedContextMenu = menuService.createMenu(MenuId.DebugCallStackContext, contextKeyService);
|
||||
@@ -116,16 +119,11 @@ export class CallStackView extends ViewPane {
|
||||
this.pauseMessageLabel.title = thread.stoppedDetails.text || '';
|
||||
dom.toggleClass(this.pauseMessageLabel, 'exception', thread.stoppedDetails.reason === 'exception');
|
||||
this.pauseMessage.hidden = false;
|
||||
if (this.toolbar) {
|
||||
this.toolbar.setActions([])();
|
||||
}
|
||||
this.updateActions();
|
||||
|
||||
} else {
|
||||
this.pauseMessage.hidden = true;
|
||||
if (this.toolbar) {
|
||||
const collapseAction = new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all');
|
||||
this.toolbar.setActions([collapseAction])();
|
||||
}
|
||||
this.updateActions();
|
||||
}
|
||||
|
||||
this.needsRefresh = false;
|
||||
@@ -150,7 +148,17 @@ export class CallStackView extends ViewPane {
|
||||
this.pauseMessageLabel = dom.append(this.pauseMessage, $('span.label'));
|
||||
}
|
||||
|
||||
getActions(): IAction[] {
|
||||
if (this.pauseMessage.hidden) {
|
||||
return [new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all')];
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
renderBody(container: HTMLElement): void {
|
||||
super.renderBody(container);
|
||||
|
||||
dom.addClass(container, 'debug-call-stack');
|
||||
const treeContainer = renderViewTree(container);
|
||||
|
||||
@@ -197,7 +205,7 @@ export class CallStackView extends ViewPane {
|
||||
},
|
||||
expandOnlyOnTwistieClick: true,
|
||||
overrideStyles: {
|
||||
listBackground: SIDE_BAR_BACKGROUND
|
||||
listBackground: this.getBackgroundColor()
|
||||
}
|
||||
});
|
||||
|
||||
@@ -290,6 +298,12 @@ export class CallStackView extends ViewPane {
|
||||
this.parentSessionToExpand.add(s.parentSession);
|
||||
}
|
||||
}));
|
||||
|
||||
this._register(this.viewDescriptorService.onDidChangeLocation(({ views, from, to }) => {
|
||||
if (views.some(v => v.id === this.id)) {
|
||||
this.tree.updateOptions({ overrideStyles: { listBackground: this.getBackgroundColor() } });
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
layoutBody(height: number, width: number): void {
|
||||
|
||||
@@ -72,7 +72,7 @@ const viewContainer = Registry.as<IViewContainersRegistry>(ViewExtensions.ViewCo
|
||||
id: VIEWLET_ID,
|
||||
name: nls.localize('run', "Run"),
|
||||
ctorDescriptor: new SyncDescriptor(DebugViewPaneContainer),
|
||||
icon: 'codicon-debug-alt',
|
||||
icon: 'codicon-debug-alt-2',
|
||||
order: 13 // {{SQL CARBON EDIT}}
|
||||
}, ViewContainerLocation.Sidebar);
|
||||
|
||||
@@ -104,12 +104,12 @@ 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, 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, 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, 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, focusCommand: { id: 'workbench.debug.action.focusBreakpointsView' }, when: ContextKeyExpr.or(CONTEXT_BREAKPOINTS_EXIST, CONTEXT_DEBUG_UX.isEqualTo('default')) }], viewContainer);
|
||||
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: StartView.ID, name: StartView.LABEL, ctorDescriptor: new SyncDescriptor(StartView), 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, collapsed: true, when: ContextKeyExpr.and(CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_DEBUG_UX.isEqualTo('default')) }], 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);
|
||||
|
||||
registerCommands();
|
||||
|
||||
@@ -262,8 +262,8 @@ configurationRegistry.registerConfiguration({
|
||||
default: true
|
||||
},
|
||||
'debug.onTaskErrors': {
|
||||
enum: ['debugAnyway', 'showErrors', 'prompt'],
|
||||
enumDescriptions: [nls.localize('debugAnyway', "Ignore task errors and start debugging."), nls.localize('showErrors', "Show the Problems view and do not start debugging."), nls.localize('prompt', "Prompt user.")],
|
||||
enum: ['debugAnyway', 'showErrors', 'prompt', 'cancel'],
|
||||
enumDescriptions: [nls.localize('debugAnyway', "Ignore task errors and start debugging."), nls.localize('showErrors', "Show the Problems view and do not start debugging."), nls.localize('prompt', "Prompt user."), nls.localize('cancel', "Cancel debugging.")],
|
||||
description: nls.localize('debug.onTaskErrors', "Controls what to do when errors are encountered after running a preLaunchTask."),
|
||||
default: 'prompt'
|
||||
},
|
||||
|
||||
@@ -72,6 +72,9 @@ export class DebugTaskRunner {
|
||||
await this.viewsService.openView(Constants.MARKERS_VIEW_ID);
|
||||
return Promise.resolve(TaskRunResult.Failure);
|
||||
}
|
||||
if (onTaskErrors === 'cancel') {
|
||||
return Promise.resolve(TaskRunResult.Failure);
|
||||
}
|
||||
|
||||
const taskLabel = typeof taskId === 'string' ? taskId : taskId ? taskId.name : '';
|
||||
const message = errorCount > 1
|
||||
@@ -89,12 +92,15 @@ export class DebugTaskRunner {
|
||||
cancelId: 2
|
||||
});
|
||||
|
||||
if (result.choice === 2) {
|
||||
return Promise.resolve(TaskRunResult.Failure);
|
||||
}
|
||||
|
||||
const debugAnyway = result.choice === 0;
|
||||
const cancel = result.choice = 2;
|
||||
if (result.checkboxChecked) {
|
||||
this.configurationService.updateValue('debug.onTaskErrors', debugAnyway ? 'debugAnyway' : 'showErrors');
|
||||
this.configurationService.updateValue('debug.onTaskErrors', result.choice === 0 ? 'debugAnyway' : cancel ? 'cancel' : 'showErrors');
|
||||
}
|
||||
|
||||
if (cancel) {
|
||||
return Promise.resolve(TaskRunResult.Failure);
|
||||
}
|
||||
if (debugAnyway) {
|
||||
return TaskRunResult.Success;
|
||||
|
||||
@@ -34,10 +34,11 @@ import { dispose } from 'vs/base/common/lifecycle';
|
||||
import { createMatches, FuzzyScore } from 'vs/base/common/filters';
|
||||
import { DebugContentProvider } from 'vs/workbench/contrib/debug/common/debugContentProvider';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import type { ICompressedTreeNode } from 'vs/base/browser/ui/tree/compressedObjectTreeModel';
|
||||
import type { ICompressibleTreeRenderer } from 'vs/base/browser/ui/tree/objectTree';
|
||||
import { IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
const NEW_STYLE_COMPRESS = true;
|
||||
|
||||
@@ -423,13 +424,17 @@ export class LoadedScriptsView extends ViewPane {
|
||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
||||
@IEnvironmentService private readonly environmentService: IEnvironmentService,
|
||||
@IDebugService private readonly debugService: IDebugService,
|
||||
@ILabelService private readonly labelService: ILabelService
|
||||
@ILabelService private readonly labelService: ILabelService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
) {
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('loadedScriptsSection', "Loaded Scripts Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService);
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('loadedScriptsSection', "Loaded Scripts Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
|
||||
this.loadedScriptsItemType = CONTEXT_LOADED_SCRIPTS_ITEM_TYPE.bindTo(contextKeyService);
|
||||
}
|
||||
|
||||
renderBody(container: HTMLElement): void {
|
||||
super.renderBody(container);
|
||||
|
||||
dom.addClass(container, 'debug-loaded-scripts');
|
||||
dom.addClass(container, 'show-file-icons');
|
||||
|
||||
@@ -466,7 +471,7 @@ export class LoadedScriptsView extends ViewPane {
|
||||
accessibilityProvider: new LoadedSciptsAccessibilityProvider(),
|
||||
ariaLabel: nls.localize({ comment: ['Debug is a noun in this context, not a verb.'], key: 'loadedScriptsAriaLabel' }, "Debug Loaded Scripts"),
|
||||
overrideStyles: {
|
||||
listBackground: SIDE_BAR_BACKGROUND
|
||||
listBackground: this.getBackgroundColor()
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -568,6 +573,12 @@ export class LoadedScriptsView extends ViewPane {
|
||||
}
|
||||
}));
|
||||
|
||||
this._register(this.viewDescriptorService.onDidChangeLocation(({ views, from, to }) => {
|
||||
if (views.some(v => v.id === this.id)) {
|
||||
this.tree.updateOptions({ overrideStyles: { listBackground: this.getBackgroundColor() } });
|
||||
}
|
||||
}));
|
||||
|
||||
// feature: expand all nodes when filtering (not when finding)
|
||||
let viewState: IViewState | undefined;
|
||||
this._register(this.tree.onDidChangeTypeFilterPattern(pattern => {
|
||||
|
||||
@@ -56,6 +56,7 @@ import { localize } from 'vs/nls';
|
||||
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IViewsService, IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
@@ -96,7 +97,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
|
||||
@IDebugService private readonly debugService: IDebugService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@IThemeService protected themeService: IThemeService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IModelService private readonly modelService: IModelService,
|
||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||
@ICodeEditorService codeEditorService: ICodeEditorService,
|
||||
@@ -106,9 +107,10 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
|
||||
@ITextResourcePropertiesService private readonly textResourcePropertiesService: ITextResourcePropertiesService,
|
||||
@IClipboardService private readonly clipboardService: IClipboardService,
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IKeybindingService keybindingService: IKeybindingService
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
) {
|
||||
super({ ...(options as IViewPaneOptions), id: REPL_VIEW_ID, ariaHeaderLabel: localize('debugConsole', "Debug Console") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService);
|
||||
super({ ...(options as IViewPaneOptions), id: REPL_VIEW_ID, ariaHeaderLabel: localize('debugConsole', "Debug Console") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
|
||||
|
||||
this.history = new HistoryNavigator(JSON.parse(this.storageService.get(HISTORY_STORAGE_KEY, StorageScope.WORKSPACE, '[]')), 50);
|
||||
codeEditorService.registerDecorationType(DECORATION_KEY, {});
|
||||
@@ -431,6 +433,8 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
|
||||
// --- Creation
|
||||
|
||||
protected renderBody(parent: HTMLElement): void {
|
||||
super.renderBody(parent);
|
||||
|
||||
this.container = dom.append(parent, $('.repl'));
|
||||
const treeContainer = dom.append(this.container, $('.repl-tree'));
|
||||
this.createReplInput(this.container);
|
||||
|
||||
@@ -26,6 +26,7 @@ import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
const $ = dom.$;
|
||||
|
||||
interface DebugStartMetrics {
|
||||
@@ -63,7 +64,7 @@ export class StartView extends ViewPane {
|
||||
|
||||
constructor(
|
||||
options: IViewletViewOptions,
|
||||
@IThemeService private readonly themeService: IThemeService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IKeybindingService keybindingService: IKeybindingService,
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@@ -75,9 +76,10 @@ export class StartView extends ViewPane {
|
||||
@IFileDialogService private readonly dialogService: IFileDialogService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
) {
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: localize('debugStart', "Debug Start Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService);
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: localize('debugStart', "Debug Start Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
|
||||
this._register(editorService.onDidActiveEditorChange(() => this.updateView()));
|
||||
this._register(this.debugService.getConfigurationManager().onDidRegisterDebugger(() => this.updateView()));
|
||||
}
|
||||
@@ -156,6 +158,8 @@ export class StartView extends ViewPane {
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement): void {
|
||||
super.renderBody(container);
|
||||
|
||||
this.firstMessageContainer = $('.top-section');
|
||||
container.appendChild(this.firstMessageContainer);
|
||||
|
||||
|
||||
@@ -30,8 +30,9 @@ import { HighlightedLabel, IHighlight } from 'vs/base/browser/ui/highlightedlabe
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { dispose } from 'vs/base/common/lifecycle';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
const $ = dom.$;
|
||||
let forgetScopes = true;
|
||||
@@ -54,9 +55,11 @@ export class VariablesView extends ViewPane {
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
|
||||
@IClipboardService private readonly clipboardService: IClipboardService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
) {
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('variablesSection', "Variables Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService);
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('variablesSection', "Variables Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
|
||||
|
||||
// Use scheduler to prevent unnecessary flashing
|
||||
this.onFocusStackFrameScheduler = new RunOnceScheduler(async () => {
|
||||
@@ -85,6 +88,8 @@ export class VariablesView extends ViewPane {
|
||||
}
|
||||
|
||||
renderBody(container: HTMLElement): void {
|
||||
super.renderBody(container);
|
||||
|
||||
dom.addClass(container, 'debug-variables');
|
||||
const treeContainer = renderViewTree(container);
|
||||
|
||||
@@ -96,7 +101,7 @@ export class VariablesView extends ViewPane {
|
||||
identityProvider: { getId: (element: IExpression | IScope) => element.getId() },
|
||||
keyboardNavigationLabelProvider: { getKeyboardNavigationLabel: (e: IExpression | IScope) => e },
|
||||
overrideStyles: {
|
||||
listBackground: SIDE_BAR_BACKGROUND
|
||||
listBackground: this.getBackgroundColor()
|
||||
}
|
||||
});
|
||||
|
||||
@@ -104,10 +109,6 @@ export class VariablesView extends ViewPane {
|
||||
|
||||
CONTEXT_VARIABLES_FOCUSED.bindTo(this.tree.contextKeyService);
|
||||
|
||||
if (this.toolbar) {
|
||||
const collapseAction = new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all');
|
||||
this.toolbar.setActions([collapseAction])();
|
||||
}
|
||||
this.tree.updateChildren();
|
||||
|
||||
this._register(this.debugService.getViewModel().onDidFocusStackFrame(sf => {
|
||||
@@ -142,6 +143,15 @@ export class VariablesView extends ViewPane {
|
||||
this.tree.rerender(e);
|
||||
}
|
||||
}));
|
||||
this._register(this.viewDescriptorService.onDidChangeLocation(({ views, from, to }) => {
|
||||
if (views.some(v => v.id === this.id)) {
|
||||
this.tree.updateOptions({ overrideStyles: { listBackground: this.getBackgroundColor() } });
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
getActions(): IAction[] {
|
||||
return [new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all')];
|
||||
}
|
||||
|
||||
layoutBody(width: number, height: number): void {
|
||||
|
||||
@@ -30,8 +30,9 @@ import { IHighlight } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel
|
||||
import { variableSetEmitter, VariablesRenderer } from 'vs/workbench/contrib/debug/browser/variablesView';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { dispose } from 'vs/base/common/lifecycle';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
const MAX_VALUE_RENDER_LENGTH_IN_VIEWLET = 1024;
|
||||
let ignoreVariableSetEmitter = false;
|
||||
@@ -52,8 +53,10 @@ export class WatchExpressionsView extends ViewPane {
|
||||
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
) {
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('watchExpressionsSection', "Watch Expressions Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService);
|
||||
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: nls.localize('watchExpressionsSection', "Watch Expressions Section") }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
|
||||
|
||||
this.onWatchExpressionsUpdatedScheduler = new RunOnceScheduler(() => {
|
||||
this.needsRefresh = false;
|
||||
@@ -62,6 +65,8 @@ export class WatchExpressionsView extends ViewPane {
|
||||
}
|
||||
|
||||
renderBody(container: HTMLElement): void {
|
||||
super.renderBody(container);
|
||||
|
||||
dom.addClass(container, 'debug-watch');
|
||||
const treeContainer = renderViewTree(container);
|
||||
|
||||
@@ -83,20 +88,13 @@ export class WatchExpressionsView extends ViewPane {
|
||||
},
|
||||
dnd: new WatchExpressionsDragAndDrop(this.debugService),
|
||||
overrideStyles: {
|
||||
listBackground: SIDE_BAR_BACKGROUND
|
||||
listBackground: this.getBackgroundColor()
|
||||
}
|
||||
});
|
||||
|
||||
this.tree.setInput(this.debugService);
|
||||
CONTEXT_WATCH_EXPRESSIONS_FOCUSED.bindTo(this.tree.contextKeyService);
|
||||
|
||||
if (this.toolbar) {
|
||||
const addWatchExpressionAction = new AddWatchExpressionAction(AddWatchExpressionAction.ID, AddWatchExpressionAction.LABEL, this.debugService, this.keybindingService);
|
||||
const collapseAction = new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all');
|
||||
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(async we => {
|
||||
@@ -140,6 +138,11 @@ export class WatchExpressionsView extends ViewPane {
|
||||
this.tree.rerender(e);
|
||||
}
|
||||
}));
|
||||
this._register(this.viewDescriptorService.onDidChangeLocation(({ views, from, to }) => {
|
||||
if (views.some(v => v.id === this.id)) {
|
||||
this.tree.updateOptions({ overrideStyles: { listBackground: this.getBackgroundColor() } });
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
layoutBody(height: number, width: number): void {
|
||||
@@ -150,6 +153,14 @@ export class WatchExpressionsView extends ViewPane {
|
||||
this.tree.domFocus();
|
||||
}
|
||||
|
||||
getActions(): IAction[] {
|
||||
return [
|
||||
new AddWatchExpressionAction(AddWatchExpressionAction.ID, AddWatchExpressionAction.LABEL, this.debugService, this.keybindingService),
|
||||
new CollapseAction(this.tree, true, 'explorer-action codicon-collapse-all'),
|
||||
new RemoveAllWatchExpressionsAction(RemoveAllWatchExpressionsAction.ID, RemoveAllWatchExpressionsAction.LABEL, this.debugService, this.keybindingService)
|
||||
];
|
||||
}
|
||||
|
||||
private onMouseDblClick(e: ITreeMouseEvent<IExpression>): void {
|
||||
if ((e.browserEvent.target as HTMLElement).className.indexOf('twistie') >= 0) {
|
||||
// Ignore double click events on twistie
|
||||
|
||||
@@ -467,7 +467,7 @@ export interface IDebugConfiguration {
|
||||
closeOnEnd: boolean;
|
||||
};
|
||||
focusWindowOnBreak: boolean;
|
||||
onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt';
|
||||
onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt' | 'cancel';
|
||||
showBreakpointsInOverviewRuler: boolean;
|
||||
showInlineBreakpointCandidates: boolean;
|
||||
}
|
||||
|
||||
@@ -105,38 +105,43 @@ export function isUri(s: string | undefined): boolean {
|
||||
return !!(s && s.match(_schemePattern));
|
||||
}
|
||||
|
||||
function stringToUri(path: string): string {
|
||||
if (typeof path === 'string') {
|
||||
if (isUri(path)) {
|
||||
return <string><unknown>uri.parse(path);
|
||||
function stringToUri(source: PathContainer): string | undefined {
|
||||
if (typeof source.path === 'string') {
|
||||
if (typeof source.sourceReference === 'number' && source.sourceReference > 0) {
|
||||
// if there is a source reference, don't touch path
|
||||
} else {
|
||||
// assume path
|
||||
if (isAbsolute(path)) {
|
||||
return <string><unknown>uri.file(path);
|
||||
if (isUri(source.path)) {
|
||||
return <string><unknown>uri.parse(source.path);
|
||||
} else {
|
||||
// leave relative path as is
|
||||
// assume path
|
||||
if (isAbsolute(source.path)) {
|
||||
return <string><unknown>uri.file(source.path);
|
||||
} else {
|
||||
// leave relative path as is
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return path;
|
||||
return source.path;
|
||||
}
|
||||
|
||||
function uriToString(path: string): string {
|
||||
if (typeof path === 'object') {
|
||||
const u = uri.revive(path);
|
||||
function uriToString(source: PathContainer): string | undefined {
|
||||
if (typeof source.path === 'object') {
|
||||
const u = uri.revive(source.path);
|
||||
if (u.scheme === 'file') {
|
||||
return u.fsPath;
|
||||
} else {
|
||||
return u.toString();
|
||||
}
|
||||
}
|
||||
return path;
|
||||
return source.path;
|
||||
}
|
||||
|
||||
// path hooks helpers
|
||||
|
||||
interface PathContainer {
|
||||
path?: string;
|
||||
sourceReference?: number;
|
||||
}
|
||||
|
||||
export function convertToDAPaths(message: DebugProtocol.ProtocolMessage, toUri: boolean): DebugProtocol.ProtocolMessage {
|
||||
@@ -148,7 +153,7 @@ export function convertToDAPaths(message: DebugProtocol.ProtocolMessage, toUri:
|
||||
|
||||
convertPaths(msg, (toDA: boolean, source: PathContainer | undefined) => {
|
||||
if (toDA && source) {
|
||||
source.path = source.path ? fixPath(source.path) : undefined;
|
||||
source.path = fixPath(source);
|
||||
}
|
||||
});
|
||||
return msg;
|
||||
@@ -163,7 +168,7 @@ export function convertToVSCPaths(message: DebugProtocol.ProtocolMessage, toUri:
|
||||
|
||||
convertPaths(msg, (toDA: boolean, source: PathContainer | undefined) => {
|
||||
if (!toDA && source) {
|
||||
source.path = source.path ? fixPath(source.path) : undefined;
|
||||
source.path = fixPath(source);
|
||||
}
|
||||
});
|
||||
return msg;
|
||||
|
||||
Reference in New Issue
Block a user