* Called when we get a disconnect for a target. We stop the * specific target if we can, otherwise we just tear down the session.
(target: ITarget, container: Container)
| 395 | * specific target if we can, otherwise we just tear down the session. |
| 396 | */ |
| 397 | private async detachTarget(target: ITarget, container: Container) { |
| 398 | container.get<ITelemetryReporter>(ITelemetryReporter).flush(); |
| 399 | if (!this.targetList().includes(target)) { |
| 400 | return {}; |
| 401 | } |
| 402 | |
| 403 | if (target.canDetach()) { |
| 404 | await target.detach(); |
| 405 | this._releaseTarget(target); |
| 406 | } else { |
| 407 | this._disconnect(); |
| 408 | } |
| 409 | |
| 410 | return {}; |
| 411 | } |
| 412 | |
| 413 | /** |
| 414 | * Called when we get a terminate for a target. We stop the |
no test coverage detected