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)
| 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. */ |
| 297 | function 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). */ |
no test coverage detected