MCPcopy Create free account
hub / github.com/Snapchat/Valdi / detachTarget

Method detachTarget

valdi/vscode_debugger/src/binder.ts:397–411  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 1

attachMethod · 0.95

Calls 7

targetListMethod · 0.95
_releaseTargetMethod · 0.95
_disconnectMethod · 0.95
flushMethod · 0.65
getMethod · 0.65
canDetachMethod · 0.65
detachMethod · 0.65

Tested by

no test coverage detected