Open gonzojive opened 2 years ago
I came across a related issue: https://github.com/golang/go/issues/42965
From browsing the source, I wonder if the call to imports.GetAllCandidates from completions.go could be altered to pass in a filter derived from the directoryFilters
that gets used in the dirFound callback that imports.GetAllCandidates
uses to limit what packages it scans.
This bug may also be a duplicate of https://github.com/golang/go/issues/51265, not totally sure.
I just implemented something similar to this in https://go.dev/cl/531417.
Notes on how to implement this:
May not get to this for v0.14, which we want to cut ASAP to include a completion performance fix.
Would this completely stop gopls from scanning excluded sub directories? I was getting https://github.com/golang/go/issues/42255 because a sub-sub directory has a NFS mounted to it, and gopls apparently tried to scan the entire NFS file tree..
Related to https://github.com/golang/go/issues/48939 and reproduced in a repository.
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?
myl
within a function. The autocomplete list will include a library in thegenerated_stuff
dir, which is included in thebuild.directoryFilters
exclusion list:What did you expect to see?
Packages in generated_stuff shouldn't be included in autocomplete list?
I can't tell if this is working as intended. It came up before in https://github.com/golang/go/issues/37697, but I interpret the build.directoryFilters to mean that the generated_stuff folder should be ignored in this context as well: https://github.com/golang/vscode-go/blob/master/docs/settings.md#builddirectoryfilters.
What did you see instead?
mylib
is included in the autocomplete list.