提交 b80ec5ca 编写于 作者: I isidor

debug: better previous state computation to only fire update state in case of an actual change

fixes #37134
上级 005a0a69
......@@ -84,6 +84,7 @@ export class DebugService implements debug.IDebugService {
private debugState: IContextKey<string>;
private breakpointsToSendOnResourceSaved: Set<string>;
private launchJsonChanged: boolean;
private previousState: debug.State;
constructor(
@IStorageService private storageService: IStorageService,
......@@ -518,7 +519,6 @@ export class DebugService implements debug.IDebugService {
}
private updateStateAndEmit(sessionId?: string, newState?: debug.State): void {
const previousState = this.state;
if (sessionId) {
if (newState === debug.State.Inactive) {
this.sessionStates.delete(sessionId);
......@@ -528,11 +528,12 @@ export class DebugService implements debug.IDebugService {
}
const state = this.state;
if (previousState !== state) {
if (this.previousState !== state) {
const stateLabel = debug.State[state];
if (stateLabel) {
this.debugState.set(stateLabel.toLowerCase());
}
this.previousState = state;
this._onDidChangeState.fire(state);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册