From 5c9a0af433136b518d444c8cbe1a86d20b241cbb Mon Sep 17 00:00:00 2001 From: isidor Date: Mon, 23 Dec 2019 13:51:27 +0100 Subject: [PATCH] debug.console.closeOnEnd #82931 --- .../contrib/debug/browser/debug.contribution.ts | 7 +++---- .../contrib/debug/browser/debugService.ts | 14 +++----------- src/vs/workbench/contrib/debug/common/debug.ts | 2 +- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/vs/workbench/contrib/debug/browser/debug.contribution.ts b/src/vs/workbench/contrib/debug/browser/debug.contribution.ts index eed05336f40..569c6e57d25 100644 --- a/src/vs/workbench/contrib/debug/browser/debug.contribution.ts +++ b/src/vs/workbench/contrib/debug/browser/debug.contribution.ts @@ -213,10 +213,9 @@ configurationRegistry.registerConfiguration({ }, 'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA, 'debug.console.closeOnEnd': { - enum: ['never', 'always', 'whenOpenedByDebug'], - description: nls.localize('debug.console.closeOnEnd', "Controls what to do with the debug console when the debug session ends."), - enumDescriptions: [nls.localize('neverClose', "Remain it as-is"), nls.localize('alwaysClose', "Close it (if opened)"), nls.localize('closeWhenOpenedByDebug', "Close if the debugging process opened it, see debug.internalConsoleOptions")], - default: 'never' + type: 'boolean', + description: nls.localize('debug.console.closeOnEnd', "Controls if the debug console should be automatically closed when the debug session ends."), + default: false }, 'debug.openDebug': { enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart', 'openOnDebugBreak'], diff --git a/src/vs/workbench/contrib/debug/browser/debugService.ts b/src/vs/workbench/contrib/debug/browser/debugService.ts index a7222f4db65..4202fb46cc6 100644 --- a/src/vs/workbench/contrib/debug/browser/debugService.ts +++ b/src/vs/workbench/contrib/debug/browser/debugService.ts @@ -74,9 +74,6 @@ export class DebugService implements IDebugService { private initCancellationToken: CancellationTokenSource | undefined; private activity: IDisposable | undefined; - // Enable undefined because that makes the test easier. - private replWasOpened : boolean | undefined = false; - constructor( @IStorageService private readonly storageService: IStorageService, @IEditorService private readonly editorService: IEditorService, @@ -455,8 +452,6 @@ export class DebugService implements IDebugService { await this.launchOrAttachToSession(session); const internalConsoleOptions = session.configuration.internalConsoleOptions || this.configurationService.getValue('debug').internalConsoleOptions; - const activePanel = this.panelService.getActivePanel(); - this.replWasOpened = activePanel && activePanel.getId() === REPL_ID; if (internalConsoleOptions === 'openOnSessionStart' || (this.viewModel.firstSessionStart && internalConsoleOptions === 'openOnFirstSessionStart')) { this.panelService.openPanel(REPL_ID, false); } @@ -568,14 +563,11 @@ export class DebugService implements IDebugService { // Data breakpoints that can not be persisted should be cleared when a session ends const dataBreakpoints = this.model.getDataBreakpoints().filter(dbp => !dbp.canPersist); dataBreakpoints.forEach(dbp => this.model.removeDataBreakpoints(dbp.getId())); - } - const closeConsoleOnEnd = this.configurationService.getValue('debug').console.closeOnEnd; - if (this.panelService.getLastActivePanelId() === REPL_ID && - (closeConsoleOnEnd === 'always' || (closeConsoleOnEnd === 'whenOpenedByDebug' && !this.replWasOpened))) { - this.panelService.hideActivePanel(); + if (this.panelService.getLastActivePanelId() === REPL_ID && this.configurationService.getValue('debug').console.closeOnEnd) { + this.panelService.hideActivePanel(); + } } - })); } diff --git a/src/vs/workbench/contrib/debug/common/debug.ts b/src/vs/workbench/contrib/debug/common/debug.ts index 7f79d65778a..6720b09c23a 100644 --- a/src/vs/workbench/contrib/debug/common/debug.ts +++ b/src/vs/workbench/contrib/debug/common/debug.ts @@ -463,7 +463,7 @@ export interface IDebugConfiguration { fontFamily: string; lineHeight: number; wordWrap: boolean; - closeOnEnd: 'never' | 'always' | 'whenOpenedByDebug'; + closeOnEnd: boolean; }; focusWindowOnBreak: boolean; onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt'; -- GitLab