-
Notifications
You must be signed in to change notification settings - Fork 648
Please, ignore ignored files and folders #3036
Comments
This is a tough problem to solve, and it comes up in other cases. For example, this extension has some testdata files, and I think that a viable alternative may be to specify some directories that should be excluded by the extension. @ramya-rao-a: Is there any precedent for such configuration in other VS Code extensions? |
In my settings I have:
I also have it in my .gitignore This previously worked fine. But recently, the Go extension started showing errors in these files. Sometimes only for new files added to the .history directory. It seems random. If I restart the language server the errors go away, but sometime later they reappear. So I have to restart the language server many times per hour. It is especially annoying because vscode will slow down, presumably because there are a lot of files in the .history folder and it takes a lot of processing to check them all. I also get the message that my system is "misconfigured". I wonder if this is because it's looking at excluded files? It seems like this used to work and it was broken recently. |
Can you share the contents of your That will allow us to understand why your workspace is misconfigured. |
I filed golang/go#37697 under |
Here's a log. In this case it only looked at a new file in the excluded .history |
Thanks for providing the log. I agree that one of the issues is the ignored files, but it also seems like your project does not play well with |
Thanks for looking at this. I am aware of the build tags issue. It's not new. It's unfortunate but I realize there's no easy fix. I live with it. But what changed with excluded files like .history ? I tried moving my history directory outside my workspace, but I couldn't get it to work. Presumably something to do with the Local History extension. For now I've disabled it. |
|
This is probably also why it's continually putting old stuff back into my go.mod file - because it finds it in .history |
To avoid that you can upgrade to Go 1.14 - the behavior of |
An idea which may help to process ignored files more accurate. First, get the list of ignored files/dirs from project/workspace root ( |
@apmckinlay . To exclude your .history directory from the "Problems" tab, you may create an empty go.mod file inside .history. In my case, this helped to prevent gopls from running inside gitignored directories.` |
@nom3ad That helps, thanks. |
@nom3ad I spoke too soon. I'm still getting errors from .history files even with an empty go.mod in .history |
@nom3ad Better to explore your |
@stamblerre AFAIK there is no generic setting meant to be used for file patterns to be ignored by extensions. It has been concluded in microsoft/vscode#22289 (comment) that each extension is to provide a setting of its own for this matter. Meanwhile, there is a way to make VS Code not show the problems for the files matching the pattern in So, we circle back to the extension needing its own setting or the extension making the call that it will respect |
Thanks for the information @ramya-rao-a! We'll probably need to add additional handling for the issue on the |
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gocode -v
orcode-insiders -v
to get version of VS Code or VS Code InsidersDescribe the bug
I have .gitignore file to hide from VCS some local content, for example the .history folder which contains the local history of changes and where there are stored a lot of Go-files. When I check "Problems" tab, I see thousands warnings for the files from this .history folder (in my case 45K+). But all these errors and warnings are out of real project context.
I think vscode-go should consider ignored files and not send them for gopls processing.
The text was updated successfully, but these errors were encountered: