mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-12 09:47:20 +08:00
extract_defs.c grew a file-static is_namespace_scope_kind() that restated the
C++/CUDA case from the shared cbm_is_namespace_scope_kind() and added Nix, then
took over the def-side call site. Restating the shared predicate dropped its
TypeScript case (`internal_module`), so TS namespace members lost the namespace
segment of their qualified name on the def side while extract_unified.c and the
enclosing-scope walk in helpers.c -- both still on the shared predicate --
continued to qualify them.
The two halves then disagreed about the same symbol, and `MyNS.inner()` stopped
resolving: the call site looked for `.MyNS.inner` and the definition had been
minted without the `MyNS` segment.
Fixed by delegating to the shared predicate instead of restating part of it, so
the wrapper adds only the case the shared predicate cannot express (Nix needs
the node, because the decision depends on the binding's value rather than its
kind string). One source of truth for kind -> namespace-scope.
This is the same class of defect as a hand-maintained second copy of a list:
the copy was correct when written and silently wrong the moment the original
grew a case.
Fixes six failures, all of which pass before the def-side call site changed and
none of which are in the same file as the change:
ts_lsp tslsp_nocrash_namespace
tslsp_nested_namespace_preserves_exact_callers
parallel 2 x TS_EXACT_LOCAL_CLASS edge-count parity
matrix_new_constructs 2 x app_module
ts_lsp, parallel and matrix_new_constructs: 434 passed, 0 failed.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>