mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
parent
d2ae4d766a
commit
adc4ebf7ef
|
@ -18,16 +18,15 @@ import { EventType } from 'vs/base/common/events';
|
|||
import { ActionBar, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
||||
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import * as debug from 'vs/workbench/parts/debug/common/debug';
|
||||
import { IDebugConfiguration, IDebugService, State } from 'vs/workbench/parts/debug/common/debug';
|
||||
import { AbstractDebugAction, PauseAction, ContinueAction, StepBackAction, ReverseContinueAction, StopAction, DisconnectAction, StepOverAction, StepIntoAction, StepOutAction, RestartAction, FocusProcessAction } from 'vs/workbench/parts/debug/browser/debugActions';
|
||||
import { FocusProcessActionItem } from 'vs/workbench/parts/debug/browser/debugActionItems';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { IMessageService } from 'vs/platform/message/common/message';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
import IDebugService = debug.IDebugService;
|
||||
|
||||
const $ = builder.$;
|
||||
const DEBUG_ACTIONS_WIDGET_POSITION_KEY = 'debug.actionswidgetposition';
|
||||
|
||||
|
@ -51,7 +50,8 @@ export class DebugActionsWidget implements IWorkbenchContribution {
|
|||
@IDebugService private debugService: IDebugService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@IPartService private partService: IPartService,
|
||||
@IStorageService private storageService: IStorageService
|
||||
@IStorageService private storageService: IStorageService,
|
||||
@IConfigurationService private configurationService: IConfigurationService
|
||||
) {
|
||||
this.$el = $().div().addClass('debug-actions-widget').style('top', `${partService.getTitleBarOffset()}px`);
|
||||
this.dragArea = $().div().addClass('drag-area');
|
||||
|
@ -86,9 +86,8 @@ export class DebugActionsWidget implements IWorkbenchContribution {
|
|||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
this.toDispose.push(this.debugService.onDidChangeState(() => {
|
||||
this.update();
|
||||
}));
|
||||
this.toDispose.push(this.debugService.onDidChangeState(() => this.update()));
|
||||
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(() => this.update()));
|
||||
this.toDispose.push(this.actionBar.actionRunner.addListener2(EventType.RUN, (e: any) => {
|
||||
// check for error
|
||||
if (e.error && !errors.isPromiseCanceledError(e.error)) {
|
||||
|
@ -156,8 +155,7 @@ export class DebugActionsWidget implements IWorkbenchContribution {
|
|||
}
|
||||
|
||||
private update(): void {
|
||||
const state = this.debugService.state;
|
||||
if (state === debug.State.Inactive) {
|
||||
if (this.debugService.state === State.Inactive || this.configurationService.getConfiguration<IDebugConfiguration>('debug').hideActionBar) {
|
||||
return this.hide();
|
||||
}
|
||||
|
||||
|
@ -214,10 +212,10 @@ export class DebugActionsWidget implements IWorkbenchContribution {
|
|||
|
||||
return this.allActions.filter(a => {
|
||||
if (a.id === ContinueAction.ID) {
|
||||
return state !== debug.State.Running;
|
||||
return state !== State.Running;
|
||||
}
|
||||
if (a.id === PauseAction.ID) {
|
||||
return state === debug.State.Running;
|
||||
return state === State.Running;
|
||||
}
|
||||
if (a.id === StepBackAction.ID) {
|
||||
return process && process.session.capabilities.supportsStepBack;
|
||||
|
|
|
@ -277,6 +277,7 @@ export interface IDebugConfiguration {
|
|||
allowBreakpointsEverywhere: boolean;
|
||||
openExplorerOnEnd: boolean;
|
||||
inlineValues: boolean;
|
||||
hideActionBar: boolean;
|
||||
}
|
||||
|
||||
export interface IGlobalConfig {
|
||||
|
|
|
@ -165,6 +165,11 @@ configurationRegistry.registerConfiguration({
|
|||
type: 'boolean',
|
||||
description: nls.localize({ comment: ['This is the description for a setting'], key: 'inlineValues' }, "Show variable values inline in editor while debugging"),
|
||||
default: false
|
||||
},
|
||||
'debug.hideActionBar': {
|
||||
type: 'boolean',
|
||||
description: nls.localize({ comment: ['This is the description for a setting'], key: 'hideActionBar' }, "Controls if the floating debug action bar should be hidden"),
|
||||
default: false
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue