* Called when we get a terminate for a target. We stop the * specific target if we can, otherwise we just tear down the session.
(target: ITarget, container: Container)
| 415 | * specific target if we can, otherwise we just tear down the session. |
| 416 | */ |
| 417 | private stopTarget(target: ITarget, container: Container) { |
| 418 | container.get<ITelemetryReporter>(ITelemetryReporter).flush(); |
| 419 | if (!this.targetList().includes(target)) { |
| 420 | return Promise.resolve({}); |
| 421 | } |
| 422 | |
| 423 | if (target.canStop()) { |
| 424 | target.stop(); |
| 425 | } else { |
| 426 | this._disconnect(); |
| 427 | } |
| 428 | |
| 429 | return Promise.resolve({}); |
| 430 | } |
| 431 | |
| 432 | private _attachToNewTargets(targets: ITarget[], launcher: ILauncher) { |
| 433 | for (const target of targets.values()) { |
no test coverage detected