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

Method _attachToNewTargets

src/binder.ts:474–494  ·  view source on GitHub ↗
(targets: ITarget[], launcher: ILauncher)

Source from the content-addressed store, hash-verified

472 }
473
474 private _attachToNewTargets(targets: ITarget[], launcher: ILauncher) {
475 for (const target of targets.values()) {
476 if (!target.waitingForDebugger()) {
477 continue;
478 }
479
480 if (TreeNode.targetNodes.has(target)) {
481 continue;
482 }
483
484 const parentTarget = target.parent();
485 const parent = parentTarget ? TreeNode.targetNodes.get(parentTarget) : this._root;
486 if (!parent) {
487 throw new Error(`Got target with unknown parent: ${target.name()}`);
488 }
489
490 const node = new TreeNode(target) as TargetTreeNode;
491 parent.add(node);
492 this.attach(node, launcher);
493 }
494 }
495
496 /**
497 * Terminates all targets in the tree that aren't in the `targets` list.

Callers 1

BinderClass · 0.95

Calls 8

attachMethod · 0.95
valuesMethod · 0.80
waitingForDebuggerMethod · 0.65
hasMethod · 0.65
parentMethod · 0.65
getMethod · 0.65
nameMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected