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

Method findChildByTypes

src/extraction/tree-sitter.ts:1389–1395  ·  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

1387 * Used to locate inner type nodes (e.g. enum_specifier inside a typedef).
1388 */
1389 private findChildByTypes(node: SyntaxNode, types: string[]): SyntaxNode | null {
1390 for (let i = 0; i < node.namedChildCount; i++) {
1391 const child = node.namedChild(i);
1392 if (child && types.includes(child.type)) return child;
1393 }
1394 return null;
1395 }
1396
1397 /**
1398 * 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