MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / lastNamedOfType

Function lastNamedOfType

src/extraction/function-ref.ts:606–616  ·  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

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

Callers 1

normalizeSpecialFunction · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected