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
Commit 6e784c3
Browse filesBrowse the repository at this point in the historyBrowse files
fix(lsp): name Go init() callers per file in the Go LSP
DeusData#1910 gives every Go init() its own QN, pkg.init#<file>:<N>, on the def
side and in compute_func_qn. The Go LSP computes its enclosing-function
QN on its own and still produced the flat pkg.init. The pipeline joins
LSP rows to textual calls by exact caller QN, so every LSP resolution
inside an init body missed the join: typed calls fell back to the
registry resolver and callable references (Register(fn)) were dropped.
On kubernetes (8c078bc3), without this commit all 499 lsp_* CALLS from
init bodies fell back (import_map, same_module, unique_name) and all
562 CALL_REFERENCE edges from them were lost; with it, the init edges
match main's strategy mix.
- helpers.c: cbm_go_init_qn is the one formula for all three sides
(def extractor, compute_func_qn, Go LSP process_function). The
per-file ordinal now walks the top-level declarations with a cursor:
ts_node_named_child(root, i) is O(i) per call, so the indexed loop was
quadratic on wide generated files.
- go_lsp: GoLSPContext carries the file's rel_path. cbm_run_go_lsp,
cbm_run_go_lsp_cross and cbm_run_go_lsp_cross_with_registry take it,
so the per-file walk, the shared Tier-2 registry walk and the per-file
fallback all name init callers like the def side. Tier 3 copies the
per-file rows' caller QN, so it follows.
- pass_lsp_cross: the dispatch passes rel to the Tier-2 walk and to the
per-file fallback (cbm_pxc_run_one_with_php_bindings gains rel_path;
the incremental route can run without shared registries).
- compute_func_qn: a NULL base QN keeps the flat QN, as the receiver
branch above it does.
Tests: golsp_init_caller_qn_matches_def (per-file rows and the caller
join), golsp_crossfile_init_caller_qn_per_file (both cross entry
points), pipeline_go_init_lsp_edges_per_file and its _parallel twin
(three inits in two files: lsp_ CALLS and a CALL_REFERENCE on the right
init, no cross-wiring, nothing onto a decoy), and
pipeline_go_init_dispatch_fallback_names_init_caller. Each fails with
its piece reverted; the pipeline tests also fail with the
compute_func_qn mirror disabled, which no test covered before.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
0 commit comments