MCPcopy
hub / github.com/microsoft/vscode-js-debug / _markTargetAsTerminated

Method _markTargetAsTerminated

src/binder.ts:510–532  ·  view source on GitHub ↗

* Marks the target as terminated, called when the target lists change.

(
    node: TreeNode,
    terminateArgs: Dap.TerminatedEventParams = {},
  )

Source from the content-addressed store, hash-verified

508 * Marks the target as terminated, called when the target lists change.
509 */
510 private async _markTargetAsTerminated(
511 node: TreeNode,
512 terminateArgs: Dap.TerminatedEventParams = {},
513 ) {
514 if (node.state >= TargetState.Terminating) {
515 await node.waitUntil(TargetState.Terminated);
516 return {};
517 }
518
519 node.state = TargetState.Terminating;
520 if (isTargetTreeNode(node)) {
521 const threadData = await node.threadData.promise;
522 await threadData.thread.dispose();
523 threadData.debugAdapter.dap.terminated(terminateArgs);
524 threadData.debugAdapter.dispose();
525 } else {
526 this._dap.terminated(terminateArgs);
527 }
528
529 await node.waitUntilChildrenAre(TargetState.Terminated);
530 node.state = TargetState.Terminated;
531 return {};
532 }
533
534 /**
535 * DAP method call to terminate a target. Resolves once the target and

Callers 2

_bootMethod · 0.95

Calls 5

isTargetTreeNodeFunction · 0.85
terminatedMethod · 0.80
waitUntilChildrenAreMethod · 0.80
waitUntilMethod · 0.65
disposeMethod · 0.65

Tested by

no test coverage detected