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
gopls should return both projects workspace_folders in both senarios
The text was updated successfully, but these errors were encountered:
gopherbot
added
Tools
This label describes issues relating to any tools in the x/tools repository.
gopls
Issues related to the Go language server, gopls.
labels
Jan 2, 2025
Hi @kkrime, gopls does not return workspace folders: those are provided by the LSP client. Which nvim client are you using?
FWIW, I use coc.nvim, and frequently work in the x/tools and x/tools/gopls modules. I use a go.work file to unify the two modules into a single workspace.
Nevertheless, if you open a file in inner_project, gopls should automatically detect the distinct build configuration, and work correctly in the inner module. But it won't consider the module part of the workspace until you open a file in it.
Closing as (AFAICT) this is a client issue. Please comment if I'm misunderstanding.
Go version
gopls v0.17.1
Output of
go env
in your module/workspace:What did you do?
If we have the following:
outter_project
:/User/kkrime/go/src/outter_project
inner_project
:/User/kkrime/go/src/outter_project/inner_project
Both projects are vaild go projects with all the files you'd expect in the root of a golang project folder
What did you see happen?
If you open the
outter_project
first then open theinner_project
, then gopls will only return theoutter_project
as aworkspace_folder
nvim outta_project/main.go outter_project/innner_project/main.go -O
If you do it the other way round i.e first open the
inner_project
then open theoutter_project
,gopls
will return both projectsworkspace_folder
nvim outter_project/innner_project/main.go outta_project/main.go -O
What did you expect to see?
gopls
should return both projectsworkspace_folders
in both senariosThe text was updated successfully, but these errors were encountered: