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 4b03f7a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(go-lsp): follow a type alias declared in another file of the package
`CBMRegisteredType.alias_of` is followed by the method lookup
(go_lookup_field_or_method_depth), but only the per-file AST scan ever
set it, and that scan only sees the file it walks. The def-driven
registration that builds the cross-file registries had no alias target
to copy, because neither CBMDefinition nor CBMLSPDef carried one. So a
`type FeatureSet = bitmap` in one file was invisible to `reqs.Set()` in
another. Since receiver-qualified method QNs (DeusData#1913), the call no longer
resolves by name coincidence either, and it got no CALLS edge at all.
The Go extractor now records the aliased type text of a `type A = B`
(CBMDefinition.alias_target). pass_lsp_cross copies it into CBMLSPDef,
and both cross-file registrars (cbm_run_go_lsp_cross and
cbm_go_build_cross_registry) qualify it against the def's module and
set alias_of. Only a bare identifier target is qualified, which is a
type in the same package. A qualified, pointer, composite or generic
target is left unset rather than guessed. A defined type `type A B` is
a type_spec, so it never gets an alias target and keeps its own method
set.
The persisted LSP surface carries the new field ("al"), so
SURFACE_CODEC_VERSION goes from 3 to 4: existing caches re-extract once,
and an incremental run sees the same alias as a full one. The literal
version-3 surfaces in the codec tests move to 4.
Tests: golsp_crossfile_type_alias_method (+_prebuilt) check both
registries, with a same-named decoy and a defined-type negative.
pipeline_go_crossfile_type_alias_method (+_parallel) index the
three-file package from the issue. Before the fix, Use had no CALLS
edge to Set.
FixesDeusData#2033
Signed-off-by: Gaurav Dubey <gauravdubey0107@gmail.com>
0 commit comments