x/tools/gopls: DocumentHighlight does not return correct locations for non-main module packages #43848
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Start with the following setup:
Run
go mod tidy
to populate thego.sum
(not included above for brevity).Open
main.go
, navigate to the definition ofgo/packages.Load
, place the cursor over thecfg
parameter declaration, then invokeDocumentHighlight
. You will get a response as follows:I.e. the response only includes the declaration of
cfg
, not its usages.Performing such a request for an identifier in a main module package works as expected, i.e. all references to the identifier are returned.
What did you expect to see?
As above.
What did you see instead?
As above.
cc @stamblerre
FYI @leitzler
The text was updated successfully, but these errors were encountered: