From ab9560852a8497af613a985bdd849a57270a455f Mon Sep 17 00:00:00 2001 From: isidor Date: Tue, 26 Sep 2017 11:32:10 +0200 Subject: [PATCH] Revert "debug: polish process focusing on continued" This reverts commit b900681057da3ee9435d97d7f36a93449bf8766e. --- .../parts/debug/electron-browser/debugService.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 52015666642..3564fd84e2e 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -244,7 +244,7 @@ export class DebugService implements debug.IDebugService { } } - private autoFocusAndOpenStackFrame(thread: debug.IThread): TPromise { + private tryToAutoFocusStackFrame(thread: debug.IThread): TPromise { const callStack = thread.getCallStack(); if (!callStack.length || (this.viewModel.focusedStackFrame && this.viewModel.focusedStackFrame.thread.threadId === thread.threadId)) { return TPromise.as(null); @@ -295,7 +295,7 @@ export class DebugService implements debug.IDebugService { // Call fetch call stack twice, the first only return the top stack frame. // Second retrieves the rest of the call stack. For performance reasons #25605 this.model.fetchCallStack(thread).then(() => { - return this.autoFocusAndOpenStackFrame(thread); + return this.tryToAutoFocusStackFrame(thread); }); } }, errors.onUnexpectedError); @@ -324,9 +324,7 @@ export class DebugService implements debug.IDebugService { const threadId = event.body.allThreadsContinued !== false ? undefined : event.body.threadId; this.model.clearThreads(session.getId(), false, threadId); if (this.viewModel.focusedProcess.getId() === session.getId()) { - this.focusStackFrameAndEvaluate(undefined).done(() => { - return this.viewModel.focusedStackFrame ? this.viewModel.focusedStackFrame.openInEditor(this.editorService, true) : undefined; - }, errors.onUnexpectedError); + this.focusStackFrameAndEvaluate(null, this.viewModel.focusedProcess).done(null, errors.onUnexpectedError); } this.updateStateAndEmit(session.getId(), debug.State.Running); })); @@ -538,11 +536,7 @@ export class DebugService implements debug.IDebugService { public focusStackFrameAndEvaluate(stackFrame: debug.IStackFrame, process?: debug.IProcess, explicit?: boolean): TPromise { if (!process) { const processes = this.model.getProcesses(); - if (stackFrame) { - process = stackFrame.thread.process; - } else if (processes.length > 0) { - process = processes.filter(p => p.getAllThreads().some(t => t.stopped)).shift() || processes[0]; - } + process = stackFrame ? stackFrame.thread.process : processes.length ? processes[0] : null; } if (!stackFrame) { const threads = process ? process.getAllThreads() : null; -- GitLab