MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / handleDebugSessionEnd

Method handleDebugSessionEnd

src/extension/commands/debug.ts:645–680  ·  view source on GitHub ↗
(s: vs.DebugSession)

Source from the content-addressed store, hash-verified

643 }
644
645 public handleDebugSessionEnd(s: vs.DebugSession): void {
646 const sessionIndex = debugSessions.findIndex((ds) => ds.session.id === s.id);
647 if (sessionIndex === -1)
648 return;
649
650 // Grab the session and remove it from the list so we don't try to interact with it anymore.
651 const session = debugSessions[sessionIndex];
652 session.hasEnded = true;
653 debugSessions.splice(sessionIndex, 1);
654 this.updateDebugSessionsStatus();
655 debugSessionStoppedEmitter.fire(session);
656 debugSessionsChangedEmitter.fire();
657
658 // Close any in-progress progress notifications.
659 for (const progressId of Object.keys(session.progress))
660 session.progress[progressId]?.complete();
661
662 // If this was the last session terminating, then remove all the flags for which service extensions are supported.
663 // Really we should track these per-session, but the changes of them being different given we only support one
664 // SDK at a time are practically zero.
665 if (debugSessions.length === 0) {
666 this.vmServices.markAllServicesUnloaded();
667 this.vmServices.markAllServiceExtensionsUnloaded();
668 this.debugOptions.hide();
669 this.debugMetrics.hide();
670 isInFlutterDebugModeDebugSession = false;
671 isInFlutterProfileModeDebugSession = false;
672 for (const debugContext of [
673 isInDartDebugSessionContext,
674 isInFlutterDebugModeDebugSessionContext,
675 isInFlutterProfileModeDebugSessionContext,
676 isInFlutterReleaseModeDebugSessionContext,
677 ])
678 void vs.commands.executeCommand("setContext", debugContext, false);
679 }
680 }
681
682 private handleCustomEvent(e: vs.DebugSessionCustomEvent): boolean {
683 const event = e.event;

Callers 1

constructorMethod · 0.95

Calls 6

completeMethod · 0.80
executeCommandMethod · 0.65
fireMethod · 0.45

Tested by

no test coverage detected