debug: do not show toolbar while initialising

fixes #84228
This commit is contained in:
isidor 2020-08-20 11:05:01 +02:00
parent 160fd51f71
commit 135b6da837
3 changed files with 13 additions and 8 deletions

View file

@ -982,10 +982,10 @@ function getActions(instantiationService: IInstantiationService, element: IDebug
}
class StopAction extends Action {
export class StopAction extends Action {
constructor(
private readonly session: IDebugSession,
private readonly session: IDebugSession | null,
@ICommandService private readonly commandService: ICommandService
) {
super(`action.${STOP_ID}`, STOP_LABEL, 'debug-action codicon-debug-stop');

View file

@ -91,7 +91,7 @@ export class DebugToolBar extends Themable implements IWorkbenchContribution {
this.updateScheduler = this._register(new RunOnceScheduler(() => {
const state = this.debugService.state;
const toolBarLocation = this.configurationService.getValue<IDebugConfiguration>('debug').toolBarLocation;
if (state === State.Inactive || toolBarLocation === 'docked' || toolBarLocation === 'hidden') {
if (state === State.Inactive || state === State.Initializing || toolBarLocation === 'docked' || toolBarLocation === 'hidden') {
return this.hide();
}

View file

@ -34,6 +34,7 @@ import { RunOnceScheduler } from 'vs/base/common/async';
import { ShowViewletAction } from 'vs/workbench/browser/viewlet';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { StopAction } from 'vs/workbench/contrib/debug/browser/callStackView';
export class DebugViewPaneContainer extends ViewPaneContainer {
@ -65,9 +66,7 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
super(VIEWLET_ID, { mergeViewWithContainerWhenSingleView: true }, instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService);
this.updateToolBarScheduler = this._register(new RunOnceScheduler(() => {
if (this.configurationService.getValue<IDebugConfiguration>('debug').toolBarLocation === 'docked') {
this.updateTitleArea();
}
this.updateTitleArea();
}, 20));
// When there are potential updates to the docked debug toolbar we need to update it
@ -119,6 +118,11 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
return this._register(this.instantiationService.createInstance(OpenDebugConsoleAction, OpenDebugConsoleAction.ID, OpenDebugConsoleAction.LABEL));
}
@memoize
private get stopAction(): StopAction {
return this._register(this.instantiationService.createInstance(StopAction, null));
}
@memoize
private get selectAndStartAction(): SelectAndStartAction {
return this._register(this.instantiationService.createInstance(SelectAndStartAction, SelectAndStartAction.ID, nls.localize('startAdditionalSession', "Start Additional Session")));
@ -150,12 +154,13 @@ export class DebugViewPaneContainer extends ViewPaneContainer {
return [this.toggleReplAction];
}
return [this.startAction, this.configureAction, this.toggleReplAction];
const firstAction = this.debugService.state === State.Initializing ? this.stopAction : this.startAction;
return [firstAction, this.configureAction, this.toggleReplAction];
}
get showInitialDebugActions(): boolean {
const state = this.debugService.state;
return state === State.Inactive || this.configurationService.getValue<IDebugConfiguration>('debug').toolBarLocation !== 'docked';
return state === State.Inactive || state === State.Initializing || this.configurationService.getValue<IDebugConfiguration>('debug').toolBarLocation !== 'docked';
}
getSecondaryActions(): IAction[] {