Merge from vscode 6fded8a497cd0142de3a1c607649a5423a091a25

This commit is contained in:
ADS Merger
2020-04-04 04:30:52 +00:00
parent 00cc0074f7
commit 35f1a014d5
184 changed files with 3043 additions and 2285 deletions

View File

@@ -133,7 +133,11 @@ export class CallStackView extends ViewPane {
this.needsRefresh = false;
this.dataSource.deemphasizedStackFramesToShow = [];
this.tree.updateChildren().then(() => {
this.parentSessionToExpand.forEach(s => this.tree.expand(s));
try {
this.parentSessionToExpand.forEach(s => this.tree.expand(s));
} catch (e) {
// Ignore tree expand errors if element no longer present
}
this.parentSessionToExpand.clear();
if (this.selectionNeedsUpdate) {
this.selectionNeedsUpdate = false;

View File

@@ -44,7 +44,7 @@ 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 { DebugViewPaneContainer, OpenDebugPanelAction } from 'vs/workbench/contrib/debug/browser/debugViewlet';
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';
import { BreakpointEditorContribution } from 'vs/workbench/contrib/debug/browser/breakpointEditorContribution';
@@ -91,7 +91,7 @@ const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewE
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 }]),
focusCommand: {
id: OpenDebugPanelAction.ID,
id: OpenDebugConsoleAction.ID,
keybindings: openPanelKb
},
order: 3,
@@ -120,7 +120,7 @@ registerCommands();
// register action to open viewlet
const registry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionRegistryExtensions.WorkbenchActions);
registry.registerWorkbenchAction(SyncActionDescriptor.create(OpenDebugPanelAction, OpenDebugPanelAction.ID, OpenDebugPanelAction.LABEL, openPanelKb), 'View: Debug Console', nls.localize('view', "View"));
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.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DebugToolBar, LifecyclePhase.Restored);
@@ -173,7 +173,7 @@ Registry.as<IQuickAccessRegistry>(QuickAccessExtensions.Quickaccess).registerQui
prefix: StartDebugQuickAccessProvider.PREFIX,
contextKey: 'inLaunchConfigurationsPicker',
placeholder: nls.localize('startDebugPlaceholder', "Type the name of a launch configuration to run."),
helpEntries: [{ description: nls.localize('startDebugHelp', "Start Debug Configurations"), needsEditor: false }]
helpEntries: [{ description: nls.localize('startDebuggingHelp', "Start Debugging"), needsEditor: false }]
});
// register service
@@ -363,7 +363,7 @@ registerEditorContribution(BREAKPOINT_EDITOR_CONTRIBUTION_ID, BreakpointEditorCo
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
group: '4_panels',
command: {
id: OpenDebugPanelAction.ID,
id: OpenDebugConsoleAction.ID,
title: nls.localize({ key: 'miToggleDebugConsole', comment: ['&& denotes a mnemonic'] }, "De&&bug Console")
},
order: 2

View File

@@ -346,7 +346,7 @@ export class ConfigurationManager implements IConfigurationManager {
private setCompoundSchemaValues(): void {
const compoundConfigurationsSchema = (<IJSONSchema>launchSchema.properties!['compounds'].items).properties!['configurations'];
const launchNames = this.launches.map(l =>
l.getConfigurationNames(false)).reduce((first, second) => first.concat(second), []);
l.getConfigurationNames(true)).reduce((first, second) => first.concat(second), []);
(<IJSONSchema>compoundConfigurationsSchema.items).oneOf![0].enum = launchNames;
(<IJSONSchema>compoundConfigurationsSchema.items).oneOf![1].properties!.name.enum = launchNames;
@@ -523,7 +523,7 @@ abstract class AbstractLaunch {
return config.compounds.filter(compound => compound.name === name).pop();
}
getConfigurationNames(includeCompounds = true): string[] {
getConfigurationNames(ignoreCompoundsAndPresentation = false): string[] {
const config = this.getConfig();
if (!config || (!Array.isArray(config.configurations) && !Array.isArray(config.compounds))) {
return [];
@@ -532,12 +532,14 @@ abstract class AbstractLaunch {
if (config.configurations) {
configurations.push(...config.configurations.filter(cfg => cfg && typeof cfg.name === 'string'));
}
if (includeCompounds && config.compounds) {
if (config.compounds) {
configurations.push(...config.compounds.filter(compound => typeof compound.name === 'string' && compound.configurations && compound.configurations.length));
}
if (ignoreCompoundsAndPresentation) {
return configurations.map(c => c.name);
}
if (config.compounds) {
configurations.push(...config.compounds.filter(compound => typeof compound.name === 'string' && compound.configurations && compound.configurations.length));
}
return getVisibleAndSorted(configurations).map(c => c.name);
}
}

View File

@@ -43,17 +43,26 @@ export class DebugProgressContribution implements IWorkbenchContribution {
source,
delay: 500
}, progressStep => {
let increment = 0;
let total = 0;
const reportProgress = (progress: { message?: string, percentage?: number }) => {
let increment = undefined;
if (typeof progress.percentage === 'number') {
increment = progress.percentage - total;
total += increment;
}
progressStep.report({
message: progress.message,
increment,
total: typeof increment === 'number' ? 100 : undefined,
});
};
if (progressStartEvent.body.message) {
reportProgress(progressStartEvent.body);
}
const progressUpdateListener = session.onDidProgressUpdate(e => {
if (e.body.progressId === progressStartEvent.body.progressId) {
if (typeof e.body.percentage === 'number') {
increment = e.body.percentage - increment;
}
progressStep.report({
message: e.body.message,
increment: typeof e.body.percentage === 'number' ? increment : undefined,
total: typeof e.body.percentage === 'number' ? 100 : undefined,
});
reportProgress(e.body);
}
});

View File

@@ -24,7 +24,11 @@ export class StartDebugQuickAccessProvider extends PickerQuickAccessProvider<IPi
@ICommandService private readonly commandService: ICommandService,
@INotificationService private readonly notificationService: INotificationService
) {
super(StartDebugQuickAccessProvider.PREFIX);
super(StartDebugQuickAccessProvider.PREFIX, {
noResultsPick: {
label: localize('noDebugResults', "No matching launch configurations")
}
});
}
protected getPicks(filter: string): (IQuickPickSeparator | IPickerQuickAccessItem)[] {
@@ -47,7 +51,6 @@ export class StartDebugQuickAccessProvider extends PickerQuickAccessProvider<IPi
// Launch entry
picks.push({
label: config.name,
ariaLabel: localize('entryAriaLabel', "{0}, debug picker", config.name),
description: this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE ? config.launch.name : '',
highlights: { label: highlights },
buttons: [{
@@ -89,7 +92,6 @@ export class StartDebugQuickAccessProvider extends PickerQuickAccessProvider<IPi
// Add Config entry
picks.push({
label,
ariaLabel: localize('entryAriaLabel', "{0}, debug picker", 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())

View File

@@ -34,6 +34,7 @@ import { distinct } from 'vs/base/common/arrays';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
import { localize } from 'vs/nls';
import { canceled } from 'vs/base/common/errors';
export class DebugSession implements IDebugSession {
@@ -250,6 +251,9 @@ export class DebugSession implements IDebugSession {
if (!this.raw) {
throw new Error(localize('noDebugAdapter', "No debug adapter, can not send '{0}'", 'launch or attach'));
}
if (this.parentSession && this.parentSession.state === State.Inactive) {
throw canceled();
}
// __sessionID only used for EH debugging (but we add it always for now...)
config.__sessionId = this.getId();

View File

@@ -8,7 +8,7 @@ import * as nls from 'vs/nls';
import { IAction } from 'vs/base/common/actions';
import * as DOM from 'vs/base/browser/dom';
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { IDebugService, VIEWLET_ID, State, BREAKPOINTS_VIEW_ID, IDebugConfiguration, DEBUG_PANEL_ID, CONTEXT_DEBUG_UX, CONTEXT_DEBUG_UX_KEY } from 'vs/workbench/contrib/debug/common/debug';
import { IDebugService, VIEWLET_ID, State, BREAKPOINTS_VIEW_ID, IDebugConfiguration, CONTEXT_DEBUG_UX, CONTEXT_DEBUG_UX_KEY, REPL_VIEW_ID } from 'vs/workbench/contrib/debug/common/debug';
import { StartAction, ConfigureAction, SelectAndStartAction, FocusSessionAction } from 'vs/workbench/contrib/debug/browser/debugActions';
import { StartDebugActionViewItem, FocusSessionActionViewItem } from 'vs/workbench/contrib/debug/browser/debugActionViewItems';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -30,10 +30,9 @@ import { IMenu, MenuId, IMenuService, MenuItemAction } from 'vs/platform/actions
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { MenuEntryActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { TogglePanelAction } from 'vs/workbench/browser/panel';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IViewDescriptorService } from 'vs/workbench/common/views';
import { IViewDescriptorService, IViewsService } from 'vs/workbench/common/views';
import { WelcomeView } from 'vs/workbench/contrib/debug/browser/welcomeView';
import { ToggleViewAction } from 'vs/workbench/browser/actions/layoutActions';
export class DebugViewPaneContainer extends ViewPaneContainer {
@@ -107,8 +106,8 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
}
@memoize
private get toggleReplAction(): OpenDebugPanelAction {
return this._register(this.instantiationService.createInstance(OpenDebugPanelAction, OpenDebugPanelAction.ID, OpenDebugPanelAction.LABEL));
private get toggleReplAction(): OpenDebugConsoleAction {
return this._register(this.instantiationService.createInstance(OpenDebugConsoleAction, OpenDebugConsoleAction.ID, OpenDebugConsoleAction.LABEL));
}
@memoize
@@ -231,16 +230,18 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
}
}
export class OpenDebugPanelAction extends TogglePanelAction {
export class OpenDebugConsoleAction extends ToggleViewAction {
public static readonly ID = 'workbench.debug.action.toggleRepl';
public static readonly LABEL = nls.localize('toggleDebugPanel', "Debug Console");
constructor(
id: string,
label: string,
@IPanelService panelService: IPanelService,
@IViewsService viewsService: IViewsService,
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
@IContextKeyService contextKeyService: IContextKeyService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService
) {
super(id, label, DEBUG_PANEL_ID, panelService, layoutService, 'codicon-repl');
super(id, label, REPL_VIEW_ID, viewsService, viewDescriptorService, contextKeyService, layoutService, 'codicon-debug-console');
}
}

View File

@@ -75,6 +75,11 @@ export class WelcomeView extends ViewPane {
};
this._register(editorService.onDidActiveEditorChange(setContextKey));
this._register(this.debugService.getConfigurationManager().onDidRegisterDebugger(setContextKey));
this._register(this.onDidChangeBodyVisibility(visible => {
if (visible) {
setContextKey();
}
}));
setContextKey();
const debugKeybinding = this.keybindingService.lookupKeybinding(StartAction.ID);

View File

@@ -710,7 +710,7 @@ export interface ILaunch {
* Returns the names of all configurations and compounds.
* Ignores configurations which are invalid.
*/
getConfigurationNames(includeCompounds?: boolean): string[];
getConfigurationNames(ignoreCompoundsAndPresentation?: boolean): string[];
/**
* Opens the launch.json file. Creates if it does not exist.