提交 ab956085 编写于 作者: I isidor

Revert "debug: polish process focusing on continued"

This reverts commit b9006810.
上级 92bece7b
......@@ -244,7 +244,7 @@ export class DebugService implements debug.IDebugService {
}
}
private autoFocusAndOpenStackFrame(thread: debug.IThread): TPromise<any> {
private tryToAutoFocusStackFrame(thread: debug.IThread): TPromise<any> {
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<void> {
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册