未验证 提交 204c8ec3 编写于 作者: I Isidor Nikolic 提交者: GitHub

Merge pull request #83249 from ChayimFriedman2/issue-#82931

Hide Debug Console After Session Has Stopped
...@@ -212,6 +212,12 @@ configurationRegistry.registerConfiguration({ ...@@ -212,6 +212,12 @@ configurationRegistry.registerConfiguration({
default: 'onFirstSessionStart' default: 'onFirstSessionStart'
}, },
'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA, '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'
},
'debug.openDebug': { 'debug.openDebug': {
enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart', 'openOnDebugBreak'], enum: ['neverOpen', 'openOnSessionStart', 'openOnFirstSessionStart', 'openOnDebugBreak'],
default: 'openOnSessionStart', default: 'openOnSessionStart',
......
...@@ -74,6 +74,9 @@ export class DebugService implements IDebugService { ...@@ -74,6 +74,9 @@ export class DebugService implements IDebugService {
private initCancellationToken: CancellationTokenSource | undefined; private initCancellationToken: CancellationTokenSource | undefined;
private activity: IDisposable | undefined; private activity: IDisposable | undefined;
// Enable undefined because that makes the test easier.
private replWasOpened : boolean | undefined = false;
constructor( constructor(
@IStorageService private readonly storageService: IStorageService, @IStorageService private readonly storageService: IStorageService,
@IEditorService private readonly editorService: IEditorService, @IEditorService private readonly editorService: IEditorService,
...@@ -452,6 +455,8 @@ export class DebugService implements IDebugService { ...@@ -452,6 +455,8 @@ export class DebugService implements IDebugService {
await this.launchOrAttachToSession(session); await this.launchOrAttachToSession(session);
const internalConsoleOptions = session.configuration.internalConsoleOptions || this.configurationService.getValue<IDebugConfiguration>('debug').internalConsoleOptions; 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')) { if (internalConsoleOptions === 'openOnSessionStart' || (this.viewModel.firstSessionStart && internalConsoleOptions === 'openOnFirstSessionStart')) {
this.panelService.openPanel(REPL_ID, false); this.panelService.openPanel(REPL_ID, false);
} }
...@@ -565,6 +570,12 @@ export class DebugService implements IDebugService { ...@@ -565,6 +570,12 @@ export class DebugService implements IDebugService {
dataBreakpoints.forEach(dbp => this.model.removeDataBreakpoints(dbp.getId())); 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();
}
})); }));
} }
......
...@@ -463,6 +463,7 @@ export interface IDebugConfiguration { ...@@ -463,6 +463,7 @@ export interface IDebugConfiguration {
fontFamily: string; fontFamily: string;
lineHeight: number; lineHeight: number;
wordWrap: boolean; wordWrap: boolean;
closeOnEnd: 'never' | 'always' | 'whenOpenedByDebug';
}; };
focusWindowOnBreak: boolean; focusWindowOnBreak: boolean;
onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt'; onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册