MCPcopy
hub / github.com/colbymchenry/codegraph / lastNamedOfType

Function lastNamedOfType

src/extraction/function-ref.ts:600–610  ·  view source on GitHub ↗

Rightmost descendant-or-self named child of one of the given types.

(node: SyntaxNode, types: Set<string>)

Source from the content-addressed store, hash-verified

598
599/** Rightmost descendant-or-self named child of one of the given types. */
600function lastNamedOfType(node: SyntaxNode, types: Set<string>): SyntaxNode | null {
601 let found: SyntaxNode | null = null;
602 for (let i = 0; i < node.namedChildCount; i++) {
603 const child = node.namedChild(i);
604 if (!child) continue;
605 if (types.has(child.type)) found = child;
606 const deeper = lastNamedOfType(child, types);
607 if (deeper) found = deeper;
608 }
609 return found;
610}
611
612function normalizeSpecial(
613 node: SyntaxNode,

Callers 1

normalizeSpecialFunction · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected