This commit is contained in:
isidor 2021-07-01 11:33:42 +02:00
parent a6574c8002
commit 5278e78731
No known key found for this signature in database
GPG key ID: F9280366A8370105

View file

@ -908,13 +908,19 @@ export class DebugSession implements IDebugSession {
this.model.clearThreads(this.getId(), false, threadId);
this._onDidChangeState.fire();
// If the focused thread does get stopped in the next 800ms auto focus another thread or session https://github.com/microsoft/vscode/issues/125144
setTimeout(() => {
if (typeof threadId === 'number' && this.debugService.getViewModel().focusedThread?.threadId === threadId && this.debugService.state !== State.Stopped) {
if (typeof threadId === 'number') {
const thread = this.debugService.getViewModel().focusedThread;
if (thread && thread.threadId === threadId && !thread.stopped) {
const toFocusThreadId = this.getStoppedDetails()?.threadId;
const toFocusThread = typeof toFocusThreadId === 'number' ? this.getThread(toFocusThreadId) : undefined;
this.debugService.focusStackFrame(undefined, toFocusThread);
}
}, 800);
} else {
const session = this.debugService.getViewModel().focusedSession;
if (session && session.getId() === this.getId() && session.state !== State.Stopped) {
this.debugService.focusStackFrame(undefined);
}
}
}));
const outputQueue = new Queue<void>();