Skip to content

refactor(backend): share resolution bookkeeping across language plugins - #31

Merged
MCR-3 merged 1 commit into
mainfrom
29-consolidate-language-plugin-bookkeeping
Sep 22, 2026
Merged

MCR-3 merged 1 commit into
mainfrom
29-consolidate-language-plugin-bookkeeping

Conversation

@MCR-3

@MCR-3 MCR-3 commented Sep 22, 2026

Copy link
Copy Markdown
Member

Summary

  • python.py, rust.py, and typescript.py each reimplemented the same call-dedup loop, edge-building loop, and a FunctionInfo._node stash/del convention; both now live once in backend/languages/base.py (dedupe_calls, build_edges), and the stash convention is replaced by a plain dict on each analyzer.
  • Rust's three crate-fallback scans (_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.
  • No behavior change: pure consolidation of duplicated bookkeeping surfaced by an architecture review.

Test plan

  • 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

Closes #29

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
@MCR-3
MCR-3 merged commit 5b01d8b into main Sep 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate duplicated resolution bookkeeping across language plugins

1 participant