debug.console.closeOnEnd

#82931
This commit is contained in:
isidor 2019-12-23 13:51:27 +01:00
parent 204c8ec38c
commit 5c9a0af433
3 changed files with 7 additions and 16 deletions

View file

@ -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'],

View file

@ -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<IDebugConfiguration>('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<IDebugConfiguration>('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<IDebugConfiguration>('debug').console.closeOnEnd) {
this.panelService.hideActivePanel();
}
}
}));
}

View file

@ -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';