提交 decf652d 编写于 作者: I isidor

debug: fix initialzing state

fixes #17952
上级 4f30a869
......@@ -436,9 +436,8 @@ export class DebugService implements debug.IDebugService {
if (focusedProcess) {
return this.sessionStates.get(focusedProcess.getId());
}
const processes = this.model.getProcesses();
if (processes.length > 0) {
return this.sessionStates.get(processes[0].getId());
if (this.sessionStates.size > 0) {
return debug.State.Initializing;
}
return debug.State.Inactive;
......@@ -449,7 +448,11 @@ export class DebugService implements debug.IDebugService {
}
private setStateAndEmit(sessionId: string, newState: debug.State): void {
this.sessionStates.set(sessionId, newState);
if (newState === debug.State.Inactive) {
this.sessionStates.delete(sessionId);
} else {
this.sessionStates.set(sessionId, newState);
}
this._onDidChangeState.fire();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册