x/tools/gopls: can't find definition using -mod=mod #73492
Labels
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
gopls version
go env
What did you do?
in my project i set "go.toolsEnvVars": { "GOFLAGS": "-mod=mod" } to fit the code can redirect staging file or vendor.in vendor file we can't change the code.
What did you see happen?
when i use vscode with gopls ready kubernetes code,there are some replace mod in go mod file, inorder to fit the editor can redirct right file, i set "go.toolsEnvVars": { "GOFLAGS": "-mod=mod" } in my editor. But when i find the struct or params reference us this,the gopls can't give right define or reference.
What did you expect to see?
I wan't when i set "go.toolsEnvVars": { "GOFLAGS": "-mod=mod" } in editors ,the gopls can give the right struct or params define and reference.
Editor and settings
vscode set "go.toolsEnvVars": { "GOFLAGS": "-mod=mod" }
Logs
No response
examples:
i exec
go mod vendor
to update vendor dir and gopls will index the vendor code,it also support correct reference.It show have 50 reference for this struct filed.when set -mod=mod ,gopls will redirect correct code with staging file .but find the struct filed reference ,it work bad.
The text was updated successfully, but these errors were encountered: