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

Function lastNamedOfType

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

626
627/** Rightmost descendant-or-self named child of one of the given types. */
628function lastNamedOfType(node: SyntaxNode, types: Set<string>): SyntaxNode | null {
629 let found: SyntaxNode | null = null;
630 for (const child of node.namedChildren) {
631 if (!child) continue;
632 if (types.has(child.type)) found = child;
633 const deeper = lastNamedOfType(child, types);
634 if (deeper) found = deeper;
635 }
636 return found;
637}
638
639function normalizeSpecial(
640 node: SyntaxNode,

Callers 1

normalizeSpecialFunction · 0.85

Calls 1

hasMethod · 0.80

Tested by

no test coverage detected