x/tools/gopls: gopls walks entire filesystem of a go module #52993
Labels
FrozenDueToAge
gopls/workspace
Issues related to support for modules or multi-module workspaces.
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
gopls version
go env
What did you do?
Our internal version control system is working over fuse. Big mono-repository is mounted as a virtual file system and loaded lazily on demand. Whole repository is a single go module with single go.mod file at the root.
When I open subset of big mono-repository in vscode, gopls starts walking all directories of the repository, breaking lazy load.
What did you expect to see?
gopls should interact only with directories added to workspace.
What did you see instead?
gopls scans all directories of a go module.
This issue originates imports cache. https://github.com/golang/tools/blob/cf66aec62b42a726b36e083c001d3b3231cba2b3/internal/imports/fix.go#L675-L689
It loads all directories from disk without any way of setting up excludes.
I tried adding exclude filter to gopls configuration. This patch fixed issue for me: slon/tools@bfcfbb1
Editor and settings
Logs
The text was updated successfully, but these errors were encountered: