MCPcopy
hub / github.com/thesysdev/openui / collectRefs

Function collectRefs

packages/lang-core/src/parser/merge.ts:80–85  ·  view source on GitHub ↗

* Recursively collect all Ref names from an AST node.

(node: ASTNode, out: Set<string>)

Source from the content-addressed store, hash-verified

78 * Recursively collect all Ref names from an AST node.
79 */
80function collectRefs(node: ASTNode, out: Set<string>): void {
81 walkAST(node, (current) => {
82 if (current.k === "Ref") out.add(current.n);
83 if (current.k === "RuntimeRef") out.add(current.n);
84 });
85}
86
87/**
88 * Remove statements unreachable from `root` (garbage collection).

Callers 1

gcUnreachableFunction · 0.85

Calls 1

walkASTFunction · 0.90

Tested by

no test coverage detected