debug session become inactive when shutdown. Also more precise listeners for session changes

fixes #58308
This commit is contained in:
isidor 2018-09-19 12:27:32 +02:00
parent 2adc5cccce
commit 97e20be47c
3 changed files with 8 additions and 4 deletions

View file

@ -198,15 +198,17 @@ export class FocusSessionActionItem extends SelectActionItem {
this.toDispose.push(attachSelectBoxStyler(this.selectBox, themeService));
this.debugService.getViewModel().onDidFocusStackFrame(() => {
this.toDispose.push(this.debugService.getViewModel().onDidFocusStackFrame(() => {
const session = this.debugService.getViewModel().focusedSession;
if (session) {
const index = this.debugService.getModel().getSessions().indexOf(session);
this.select(index);
}
});
}));
this.toDispose.push(this.debugService.onDidNewSession(() => this.update()));
this.toDispose.push(this.debugService.onDidEndSession(() => this.update()));
this.debugService.getModel().onDidChangeCallStack(() => this.update());
this.update();
}

View file

@ -131,7 +131,8 @@ export class StartAction extends AbstractDebugAction {
super(id, label, 'debug-action start', debugService, keybindingService);
this.toDispose.push(this.debugService.getConfigurationManager().onDidSelectConfiguration(() => this.updateEnablement()));
this.toDispose.push(this.debugService.getModel().onDidChangeCallStack(() => this.updateEnablement()));
this.toDispose.push(this.debugService.onDidNewSession(() => this.updateEnablement()));
this.toDispose.push(this.debugService.onDidEndSession(() => this.updateEnablement()));
this.toDispose.push(this.contextService.onDidChangeWorkbenchState(() => this.updateEnablement()));
}

View file

@ -725,6 +725,7 @@ export class DebugSession implements IDebugSession {
dispose(this.rawListeners);
this.model.clearThreads(this.getId(), true);
this.model.removeSession(this.getId());
this.state = State.Inactive;
this.fetchThreadsScheduler = undefined;
if (this.raw) {
this.raw.disconnect();