Skip to content

Commit 97e20be

Browse files
committed
debug session become inactive when shutdown. Also more precise listeners for session changes
fixes microsoft#58308
1 parent 2adc5cc commit 97e20be

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/vs/workbench/parts/debug/browser/debugActionItems.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,15 +198,17 @@ export class FocusSessionActionItem extends SelectActionItem {
198198

199199
this.toDispose.push(attachSelectBoxStyler(this.selectBox, themeService));
200200

201-
this.debugService.getViewModel().onDidFocusStackFrame(() => {
201+
this.toDispose.push(this.debugService.getViewModel().onDidFocusStackFrame(() => {
202202
const session = this.debugService.getViewModel().focusedSession;
203203
if (session) {
204204
const index = this.debugService.getModel().getSessions().indexOf(session);
205205
this.select(index);
206206
}
207-
});
207+
}));
208+
209+
this.toDispose.push(this.debugService.onDidNewSession(() => this.update()));
210+
this.toDispose.push(this.debugService.onDidEndSession(() => this.update()));
208211

209-
this.debugService.getModel().onDidChangeCallStack(() => this.update());
210212
this.update();
211213
}
212214

src/vs/workbench/parts/debug/browser/debugActions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ export class StartAction extends AbstractDebugAction {
131131
super(id, label, 'debug-action start', debugService, keybindingService);
132132

133133
this.toDispose.push(this.debugService.getConfigurationManager().onDidSelectConfiguration(() => this.updateEnablement()));
134-
this.toDispose.push(this.debugService.getModel().onDidChangeCallStack(() => this.updateEnablement()));
134+
this.toDispose.push(this.debugService.onDidNewSession(() => this.updateEnablement()));
135+
this.toDispose.push(this.debugService.onDidEndSession(() => this.updateEnablement()));
135136
this.toDispose.push(this.contextService.onDidChangeWorkbenchState(() => this.updateEnablement()));
136137
}
137138

src/vs/workbench/parts/debug/electron-browser/debugSession.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ export class DebugSession implements IDebugSession {
725725
dispose(this.rawListeners);
726726
this.model.clearThreads(this.getId(), true);
727727
this.model.removeSession(this.getId());
728+
this.state = State.Inactive;
728729
this.fetchThreadsScheduler = undefined;
729730
if (this.raw) {
730731
this.raw.disconnect();

0 commit comments

Comments
 (0)