mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-09 01:28:50 +01:00
Focus the editor on debug stop, by default. Fix #139950
This commit is contained in:
@@ -511,6 +511,11 @@ configurationRegistry.registerConfiguration({
|
||||
description: nls.localize('debug.focusWindowOnBreak', "Controls whether the workbench window should be focused when the debugger breaks."),
|
||||
default: true
|
||||
},
|
||||
'debug.focusEditorOnBreak': {
|
||||
type: 'boolean',
|
||||
description: nls.localize('debug.focusEditorOnBreak', "Controls whether the editor should be focused when the debugger breaks."),
|
||||
default: true
|
||||
},
|
||||
'debug.onTaskErrors': {
|
||||
enum: ['debugAnyway', 'showErrors', 'prompt', 'abort'],
|
||||
enumDescriptions: [nls.localize('debugAnyway', "Ignore task errors and start debugging."), nls.localize('showErrors', "Show the Problems view and do not start debugging."), nls.localize('prompt', "Prompt user."), nls.localize('cancel', "Cancel debugging.")],
|
||||
|
||||
@@ -958,7 +958,8 @@ export class DebugSession implements IDebugSession {
|
||||
const focusedStackFrame = this.debugService.getViewModel().focusedStackFrame;
|
||||
if (!focusedStackFrame || focusedStackFrame.thread.session === this) {
|
||||
// Only take focus if nothing is focused, or if the focus is already on the current session
|
||||
await this.debugService.focusStackFrame(undefined, thread);
|
||||
const preserveFocus = !this.configurationService.getValue<IDebugConfiguration>('debug').focusEditorOnBreak;
|
||||
await this.debugService.focusStackFrame(undefined, thread, undefined, { preserveFocus });
|
||||
}
|
||||
|
||||
if (thread.stoppedDetails) {
|
||||
|
||||
@@ -630,6 +630,7 @@ export interface IDebugConfiguration {
|
||||
acceptSuggestionOnEnter: 'off' | 'on';
|
||||
};
|
||||
focusWindowOnBreak: boolean;
|
||||
focusEditorOnBreak: boolean;
|
||||
onTaskErrors: 'debugAnyway' | 'showErrors' | 'prompt' | 'abort';
|
||||
showBreakpointsInOverviewRuler: boolean;
|
||||
showInlineBreakpointCandidates: boolean;
|
||||
|
||||
Reference in New Issue
Block a user