Skip to content

Commit 6387ea6

Browse files
author
Anton Vildyaev
committed
Fix 37385 by introducing addition configuration setting
1 parent 0c18d66 commit 6387ea6

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

src/vs/workbench/parts/debug/common/debug.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ export const INTERNAL_CONSOLE_OPTIONS_SCHEMA = {
4747
default: 'openOnFirstSessionStart',
4848
description: nls.localize('internalConsoleOptions', "Controls behavior of the internal debug console.")
4949
};
50+
export const DEBUG_VIEWLET_OPTIONS_SCHEMA = {
51+
enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart'],
52+
default: 'openOnFirstSessionStart',
53+
description: nls.localize('debugViewletOptions', "Controls whether debug viewlet should be open on debugging session start.")
54+
};
5055

5156
// raw
5257

@@ -323,6 +328,7 @@ export interface IDebugConfiguration {
323328
inlineValues: boolean;
324329
hideActionBar: boolean;
325330
internalConsoleOptions: string;
331+
debugViewletOptions: string;
326332
}
327333

328334
export interface IGlobalConfig {
@@ -336,6 +342,7 @@ export interface IEnvConfig {
336342
type: string;
337343
request: string;
338344
internalConsoleOptions?: string;
345+
debugViewletOptions?: string;
339346
preLaunchTask?: string;
340347
__restart?: any;
341348
__sessionId?: string;

src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { VariablesView, WatchExpressionsView, CallStackView, BreakpointsView } f
2020
import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
2121
import {
2222
IDebugService, VIEWLET_ID, REPL_ID, CONTEXT_NOT_IN_DEBUG_MODE, CONTEXT_IN_DEBUG_MODE, INTERNAL_CONSOLE_OPTIONS_SCHEMA,
23-
CONTEXT_DEBUG_STATE, VARIABLES_VIEW_ID, CALLSTACK_VIEW_ID, WATCH_VIEW_ID, BREAKPOINTS_VIEW_ID
23+
CONTEXT_DEBUG_STATE, VARIABLES_VIEW_ID, CALLSTACK_VIEW_ID, WATCH_VIEW_ID, BREAKPOINTS_VIEW_ID, DEBUG_VIEWLET_OPTIONS_SCHEMA
2424
} from 'vs/workbench/parts/debug/common/debug';
2525
import { IPartService } from 'vs/workbench/services/part/common/partService';
2626
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
@@ -188,6 +188,7 @@ configurationRegistry.registerConfiguration({
188188
default: false
189189
},
190190
'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA,
191+
'debug.debugViewletOptions': DEBUG_VIEWLET_OPTIONS_SCHEMA,
191192
'launch': {
192193
type: 'object',
193194
description: nls.localize({ comment: ['This is the description for a setting'], key: 'launch' }, "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces"),

src/vs/workbench/parts/debug/electron-browser/debugService.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,11 @@ export class DebugService implements debug.IDebugService {
872872
this.panelService.openPanel(debug.REPL_ID, false).done(undefined, errors.onUnexpectedError);
873873
}
874874

875-
if (!this.viewModel.changedWorkbenchViewState && (this.partService.isVisible(Parts.SIDEBAR_PART) || this.contextService.getWorkbenchState() === WorkbenchState.EMPTY)) {
876-
// We only want to change the workbench view state on the first debug session #5738 and if the side bar is not hidden
875+
const debugViewletOptions = configuration.debugViewletOptions || this.configurationService.getConfiguration<debug.IDebugConfiguration>('debug').debugViewletOptions;
876+
// Open debug viewlet based on the visibility of the side bar and debugViewletOptions setting
877+
if ((this.partService.isVisible(Parts.SIDEBAR_PART) || this.contextService.getWorkbenchState() === WorkbenchState.EMPTY)
878+
&& ((debugViewletOptions === 'openOnSessionStart')
879+
|| ((debugViewletOptions === 'openOnFirstSessionStart' && !this.viewModel.changedWorkbenchViewState)) {
877880
this.viewModel.changedWorkbenchViewState = true;
878881
this.viewletService.openViewlet(debug.VIEWLET_ID);
879882
}

0 commit comments

Comments
 (0)