mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-17 23:52:36 +00:00
python/ast-utils.ts held three language-agnostic helpers (nodeToCapture, syntheticCapture, findNodeAtRange) plus two duplicates of the shared utils version (findChildOfType == findChild; findIdentifierChild was unused). Consolidating into utils/ast-helpers.ts so the next language migrating to the scope-resolution pipeline imports from one place. findNodeAtRange rewritten iteratively using an explicit stack. Previous implementation was recursive — fine for shallow Python trees today, but a landmine for languages with deeper nesting (Kotlin sealed-hierarchy decomposition, Rust macro expansion, etc.) and the task hooks explicitly call out "no recursion". Children are pushed reverse-index so LIFO pop visits them left-to-right; row-bound pruning preserves the prior early-skip optimization (the `break` shortcut is replaced with `continue` since a stack can't leverage ordered sibling termination). findChildOfType consumers migrated to the existing findChild helper. findIdentifierChild deleted — no callers remained. Coverage: 204/204 test/integration/resolvers/python.test.ts both REGISTRY_PRIMARY_PYTHON=0 and =1. 339/339 scope-resolution + graph unit tests. tsc clean. |
||
|---|---|---|
| .. | ||
| cli | ||
| config | ||
| core | ||
| lib | ||
| mcp | ||
| server | ||
| storage | ||
| types | ||