-
Notifications
You must be signed in to change notification settings - Fork 797
setting that uses .gitignore
to exclude directories instead of build.directoryFilters
#2727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@vogtb How does I think it would be nice if we can make gopls less aggressive but smarter in its directory scanning. Understanding vscode's The existence in |
Running Using something like vscode's |
Thanks for testing One of the complications in translating I will discuss this with the team in our weekly meeting but feel free to add more ideas/opinion. |
@hyangah I am endeavoring to eliminate most if not all of the places where gopls scans the filesystem. (see e.g. https://go.dev/issue/56496). Gopls really shouldn't need to scan the filesystem, but does currently to discover modules and template files. Both of those operations can be changed to avoid a scan. Currently, gopls doesn't translate directoryFilters to |
tl;dr -- custom build writes thousands of files to target directories that are ignored by
.gitignore
. But it's not clear that gopls is not by default ignoring these, causing it to include all of my non-source files, use 100% CPU, and hang indefinitely. The build.directoryFilters setting is not immediately obvious, and I'd like an option to use.gitignore
instead, possibly by default.Problem
I work with many git submodules in a single large git module that is also my vscode workspace. Building these modules results in thousands files across their own target directories, which are all ignored with
.gitignore
at the workspace level, and individual.gitignore
files at each git submodule.When I build these modules all of them are being sent to gopls to be scanned, causing _gopls use 100% CPU and become unresponsive.
Solution
A setting that lets me use
.gitignore
to exclude files from being used by gopls. Additionally, I'd like this setting to be on by default, as it's safer and causes fewer surprises to users. This would be an alternative the existing build.directoryFilters setting.Current Alternative
I'm using
build.directoryFilters
for now, but it seems a bit weird that gopls is using "[by default] all directories".See also
The text was updated successfully, but these errors were encountered: