You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consolidate duplicated resolution bookkeeping across language plugins #29
python.py, rust.py, and typescript.py had, across separate PRs, grown three pieces of byte-identical, non-language-specific bookkeeping: the call-dedup loop, the edge-building loop, and a FunctionInfo._node = ... / del info._node dynamic-attribute stash convention (six # type: ignore[attr-defined] comments for something that never belonged on the dataclass). Rust's crate-fallback resolution (_find_impl_in_crate, _find_fn_in_crate, _find_submodule_in_crate) separately repeated the same "scan every module in a crate" loop three times, varying only the match predicate — the exact fallback area most recently touched (#25, bare module::func() resolution for src-less nested crates). Surfaced by an architecture review; none of this duplication was earning its keep, and with no test suite, nothing catches the three copies drifting apart.
Implementation is complete in the working tree as of this issue; it tracks the change through review/merge.
To-dos
Add dedupe_calls() and build_edges() to backend/languages/base.py; all three plugins call them instead of reimplementing the loops
Replace the info._node stash/del convention in all three plugins with a plain dict kept on each analyzer (self._nodes)
Consolidate Rust's three crate scans behind a shared _crate_candidates() iterator
Acceptance criteria
python -m backend.analyzer output (files/functions/edges) is byte-identical before and after, for sample_project, sample_rust_project, sample_typescript_project, and sample_rust_nested_project
No # type: ignore[attr-defined] remains in backend/languages/*.py for the node-stash pattern
Activity