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

Function firstSimpleIdentifier

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

First `simple_identifier` in `node`'s subtree (breadth-ish, first-found). * Swift's property name nests as `property_declaration → pattern → * bound_identifier → simple_identifier`; this resolves it (and the bound name of * a Kotlin/Swift property declarator for the shadow prune). For a tu

(node: SyntaxNode | null)

Source from the content-addressed store, hash-verified

295 * a Kotlin/Swift property declarator for the shadow prune). For a tuple pattern
296 * (`let (a, b)`) it returns the first — acceptable, those are rare for consts. */
297function firstSimpleIdentifier(node: SyntaxNode | null): SyntaxNode | null {
298 const stack: SyntaxNode[] = node ? [node] : [];
299 let guard = 0;
300 while (stack.length > 0 && guard++ < 40) {
301 const n = stack.shift()!;
302 if (n.type === 'simple_identifier') return n;
303 for (let i = 0; i < n.namedChildCount; i++) {
304 const c = n.namedChild(i);
305 if (c) stack.push(c);
306 }
307 }
308 return null;
309}
310
311/** Swift property facts: the bound name, whether it's a `let`, and whether it's
312 * a *computed* property (a getter block, no stored value — never a constant). */

Callers 2

swiftPropertyInfoFunction · 0.85
flushValueRefsMethod · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected