Skip to content

Commit

Permalink
Add settings option for status bar decoration in debugging session (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
KoushikSahu committed Jul 18, 2022
1 parent a567b59 commit 22aff22
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/vs/workbench/contrib/debug/browser/debug.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,11 @@ configurationRegistry.registerConfiguration({
type: 'boolean',
default: false,
description: nls.localize('debug.autoExpandLazyVariables', "Automatically show values for variables that are lazily resolved by the debugger, such as getters.")
},
'debug.DecorateStatusBar': {
type: 'boolean',
description: nls.localize({ comment: ['This is the description for a setting'], key: 'decorateStatusBar' }, "Decorate status bar when in debugger is connected."),
default: true
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
import { localize } from 'vs/nls';
import { registerColor } from 'vs/platform/theme/common/colorRegistry';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { IDebugService, State, IDebugSession } from 'vs/workbench/contrib/debug/common/debug';
import { IDebugService, State, IDebugSession, IDebugConfiguration } from 'vs/workbench/contrib/debug/common/debug';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { STATUS_BAR_FOREGROUND, STATUS_BAR_BORDER } from 'vs/workbench/common/theme';
import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';
import { IStatusbarService } from 'vs/workbench/services/statusbar/browser/statusbar';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';

// colors for theming

Expand Down Expand Up @@ -61,15 +62,17 @@ export class StatusBarColorProvider implements IWorkbenchContribution {
constructor(
@IDebugService private readonly debugService: IDebugService,
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
@IStatusbarService private readonly statusbarService: IStatusbarService
@IStatusbarService private readonly statusbarService: IStatusbarService,
@IConfigurationService private readonly configurationService: IConfigurationService
) {
this.debugService.onDidChangeState(this.update, this, this.disposables);
this.contextService.onDidChangeWorkbenchState(this.update, this, this.disposables);
this.update();
}

protected update(): void {
this.enabled = isStatusbarInDebugMode(this.debugService.state, this.debugService.getViewModel().focusedSession);
const decorateStatusBar: boolean = this.configurationService.getValue<IDebugConfiguration>('debug').decorateStatusBar;
if (decorateStatusBar) { this.enabled = isStatusbarInDebugMode(this.debugService.state, this.debugService.getViewModel().focusedSession); }
}

dispose(): void {
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/debug/common/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ export interface IDebugConfiguration {
showSourceCode: boolean;
};
autoExpandLazyVariables: boolean;
decorateStatusBar: boolean;
}

export interface IGlobalConfig {
Expand Down

0 comments on commit 22aff22

Please sign in to comment.