Skip to content

Commit bf0949b

Browse files
authored
Merge pull request microsoft#37704 from hun1ahpu/fix37385
Fix 37385 by introducing addition configuration setting
2 parents 72ea2ad + a48e16e commit bf0949b

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

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

Lines changed: 6 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 OPEN_DEBUG_OPTIONS_SCHEMA = {
51+
enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart'],
52+
default: 'openOnFirstSessionStart',
53+
description: nls.localize('openDebug', "Controls whether debug viewlet should be open on debugging session start.")
54+
};
5055

5156
// raw
5257

@@ -319,6 +324,7 @@ export enum State {
319324

320325
export interface IDebugConfiguration {
321326
allowBreakpointsEverywhere: boolean;
327+
openDebug: string;
322328
openExplorerOnEnd: boolean;
323329
inlineValues: boolean;
324330
hideActionBar: boolean;

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, OPEN_DEBUG_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.openDebug': OPEN_DEBUG_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
@@ -869,8 +869,11 @@ export class DebugService implements debug.IDebugService {
869869
this.panelService.openPanel(debug.REPL_ID, false).done(undefined, errors.onUnexpectedError);
870870
}
871871

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

0 commit comments

Comments
 (0)