| 13 | */ |
| 14 | @injectable() |
| 15 | export class CascadeTerminationTracker implements IExtensionContribution { |
| 16 | constructor(@inject(DebugSessionTracker) private readonly tracker: DebugSessionTracker) {} |
| 17 | |
| 18 | /** |
| 19 | * Registers the tracker for the extension. |
| 20 | */ |
| 21 | public register(context: vscode.ExtensionContext) { |
| 22 | context.subscriptions.push( |
| 23 | this.tracker.onSessionEnded(session => { |
| 24 | const targets: string[] = session.configuration.cascadeTerminateToConfigurations; |
| 25 | if (!targets || !(targets instanceof Array)) { |
| 26 | return; // may be a nested session |
| 27 | } |
| 28 | |
| 29 | for (const configName of targets) { |
| 30 | for (const session of this.tracker.getByName(configName)) { |
| 31 | vscode.debug.stopDebugging(session); |
| 32 | } |
| 33 | } |
| 34 | }), |
| 35 | ); |
| 36 | } |
| 37 | } |
nothing calls this directly
no outgoing calls
no test coverage detected