proper fix for #14711

This commit is contained in:
isidor
2016-11-01 16:04:52 +01:00
parent 7b0c4a606b
commit a2dddb22ae
2 changed files with 6 additions and 4 deletions

View File

@@ -71,7 +71,7 @@ export class DebugActionsWidget implements wbext.IWorkbenchContribution {
}
private registerListeners(): void {
this.toDispose.push(this.debugService.getViewModel().onDidFocusStackFrame(() => {
this.toDispose.push(this.debugService.onDidChangeState(() => {
this.update();
}));
this.toDispose.push(this.actionBar.actionRunner.addListener2(events.EventType.RUN, (e: any) => {

View File

@@ -439,9 +439,11 @@ export class DebugService implements debug.IDebugService {
return !!this.contextService.getWorkspace();
}
public setFocusedStackFrameAndEvaluate(focusedStackFrame: debug.IStackFrame): TPromise<void> {
public setFocusedStackFrameAndEvaluate(focusedStackFrame: debug.IStackFrame, process?: debug.IProcess): TPromise<void> {
const processes = this.model.getProcesses();
const process = focusedStackFrame ? focusedStackFrame.thread.process : processes.length ? processes[0] : null;
if (!process) {
process = focusedStackFrame ? focusedStackFrame.thread.process : processes.length ? processes[0] : null;
}
if (process && !focusedStackFrame) {
const thread = process.getAllThreads().pop();
const callStack = thread ? thread.getCachedCallStack() : null;
@@ -635,7 +637,7 @@ export class DebugService implements debug.IDebugService {
const process = this.model.addProcess(configuration.name, session);
if (!this.viewModel.focusedProcess) {
this.viewModel.setFocusedStackFrame(null, process);
this.setFocusedStackFrameAndEvaluate(null, process);
}
this.toDisposeOnSessionEnd[session.getId()] = [];
if (client) {