From 81671f3f34d1b3cfdcb8a8a0e266eedb7c057923 Mon Sep 17 00:00:00 2001 From: isidor Date: Tue, 10 Sep 2019 11:35:24 +0200 Subject: [PATCH] fixes #80593 --- src/vs/workbench/contrib/debug/browser/debugService.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/vs/workbench/contrib/debug/browser/debugService.ts b/src/vs/workbench/contrib/debug/browser/debugService.ts index 863fbb4e5bb..13898ad10bb 100644 --- a/src/vs/workbench/contrib/debug/browser/debugService.ts +++ b/src/vs/workbench/contrib/debug/browser/debugService.ts @@ -44,6 +44,7 @@ import { dispose, IDisposable } from 'vs/base/common/lifecycle'; import { IDebugService, State, IDebugSession, CONTEXT_DEBUG_TYPE, CONTEXT_DEBUG_STATE, CONTEXT_IN_DEBUG_MODE, IThread, IDebugConfiguration, VIEWLET_ID, REPL_ID, IConfig, ILaunch, IViewModel, IConfigurationManager, IDebugModel, IEnablement, IBreakpoint, IBreakpointData, ICompound, IGlobalConfig, IStackFrame, AdapterEndEvent, getStateLabel } from 'vs/workbench/contrib/debug/common/debug'; import { isExtensionHostDebugging } from 'vs/workbench/contrib/debug/common/debugUtils'; import { isErrorWithActions, createErrorWithActions } from 'vs/base/common/errorsWithActions'; +import { RunOnceScheduler } from 'vs/base/common/async'; import { IExtensionHostDebugService } from 'vs/platform/debug/common/extensionHostDebug'; import { isCodeEditor } from 'vs/editor/browser/editorBrowser'; import { CancellationTokenSource } from 'vs/base/common/cancellation'; @@ -492,7 +493,16 @@ export class DebugService implements IDebugService { } private registerSessionListeners(session: IDebugSession): void { + const sessionRunningScheduler = new RunOnceScheduler(() => { + // Do not immediatly defocus the stack frame if the session is running + if (session.state === State.Running && this.viewModel.focusedSession === session) { + this.viewModel.setFocus(undefined, this.viewModel.focusedThread, session, false); + } + }, 200); this.toDispose.push(session.onDidChangeState(() => { + if (session.state === State.Running && this.viewModel.focusedSession === session) { + sessionRunningScheduler.schedule(); + } if (session === this.viewModel.focusedSession) { this.onStateChange(); } -- GitLab