x/tools/gopls: workspaces ignore vendor directory when not go-getable #52587
Labels
gopls/workspace
Issues related to support for modules or multi-module workspaces.
gopls
Issues related to the Go language server, gopls.
modules
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.
Unfortunate
Milestone
gopls version
go env
What did you do?
We have the following project structure:
We have some packages in our vendor/ directory which are not go-getable, so we manage them manually in the vendor/ directory as well as in the
go.mod
. When theapi
project files are in the root directory, this absolutely works fine with gopls. But when using workspaces, gopls does not look up the impoted packages in the vendor directory and tries to go-get them instead, which is not possible for some packages. This results in anBrokenImport
error even though go build` runs without any complaints.What did you expect to see?
In my opinion, when the go toolchain allows the described procedure, gopls should also be able to accept packages which are not go-getable located only in the vendor/ directory.
What did you see instead?
gopls ignores the packages located in the modules vendor/ directory and tries to go-get them instead. This fails and results in a
BrokenImport
error even thoughgo build
runs without any problems.Editor and settings
I've tried the following project settings for a possible chance that they could fix the problem.
Logs
The logs shown below are not from the project described above because I don't want to leak any information about our project. But I've reconstructed the issue in a test project which shows the exact same behaviour.
The text was updated successfully, but these errors were encountered: