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

Method findChildByTypes

src/extraction/tree-sitter.ts:1383–1389  ·  view source on GitHub ↗

* Find first named child whose type is in the given list. * Used to locate inner type nodes (e.g. enum_specifier inside a typedef).

(node: SyntaxNode, types: string[])

Source from the content-addressed store, hash-verified

1381 * Used to locate inner type nodes (e.g. enum_specifier inside a typedef).
1382 */
1383 private findChildByTypes(node: SyntaxNode, types: string[]): SyntaxNode | null {
1384 for (let i = 0; i < node.namedChildCount; i++) {
1385 const child = node.namedChild(i);
1386 if (child && types.includes(child.type)) return child;
1387 }
1388 return null;
1389 }
1390
1391 /**
1392 * Find a `packageTypes` child under the root, create a `namespace` node

Callers 1

extractTypeAliasMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected