mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-12 09:47:20 +08:00
The unified/calls extractor used a private 4-case name resolver (resolve_func_name_node) that returned NULL for the ~130 grammars whose function node has no `name` field — Fortran subroutine, SCSS mixin, SQL create_function, Julia short-form, the Lisp/FP family, and more. On NULL, push_boundary_scopes never pushed a SCOPE_FUNC, so every call inside such a function was attributed to the enclosing Module instead of the callable (QUALITY_ANALYSIS gap #3). Export the rich resolver from extract_defs (cbm_resolve_func_name) — a strict superset that already drives definition extraction (generic name field, arrow/declarator, C/C++ declarator chain, plus the per-language quirks) — and route the calls scope path (compute_func_qn) through it, preserving the enclosing-class QN join. Definition extraction is unchanged (it already called this resolver); the two paths now share one source of truth, the same de-drift pattern used for cbm_resolve_c_declarator_name_node (#438). Reproduced by repro_invariant_enclosing_parity (Fortran, SCSS, SQL, Verilog, Julia, Nix, CommonLisp, EmacsLisp, Dart, COBOL): each asserts no CALLS edge is Module-sourced and was RED; the fix makes them callable-sourced. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>