Repository navigation
refactor(backend): share resolution bookkeeping across language plugins - #31
Merged
Merged
Conversation
python.py, rust.py, and typescript.py each reimplemented the same call-dedup loop, edge-building loop, and a FunctionInfo._node stash/del convention, with nothing to catch the three copies drifting apart in a repo with no test suite. Rust's crate-fallback scans (_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. Consolidating both gives every current and future plugin one place to fix a bookkeeping bug instead of three. Verified byte-identical analyzer output (files/functions/edges) before and after for sample_project, sample_rust_project, sample_typescript_project, and sample_rust_nested_project. Closes #29
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
python.py,rust.py, andtypescript.pyeach reimplemented the same call-dedup loop, edge-building loop, and aFunctionInfo._nodestash/del convention; both now live once inbackend/languages/base.py(dedupe_calls,build_edges), and the stash convention is replaced by a plain dict on each analyzer._find_impl_in_crate,_find_fn_in_crate,_find_submodule_in_crate) repeated the same "scan every module in a crate" loop; they now share a_crate_candidates()iterator.Test plan
python -m backend.analyzeroutput (files/functions/edges) is byte-identical before and after, forsample_project,sample_rust_project,sample_typescript_project, andsample_rust_nested_project# type: ignore[attr-defined]remains inbackend/languages/*.pyfor the node-stash patternCloses #29