MCPcopy Index your code
hub / github.com/continuedev/continue / firstChild

Function firstChild

core/indexing/chunk/code.ts:14–24  ·  view source on GitHub ↗
(
  node: SyntaxNode,
  grammarName: string | string[],
)

Source from the content-addressed store, hash-verified

12}
13
14function firstChild(
15 node: SyntaxNode,
16 grammarName: string | string[],
17): SyntaxNode | null {
18 if (Array.isArray(grammarName)) {
19 return (
20 node.children.find((child) => grammarName.includes(child.type)) || null
21 );
22 }
23 return node.children.find((child) => child.type === grammarName) || null;
24}
25
26async function collapseChildren(
27 node: SyntaxNode,

Callers 1

collapseChildrenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected