Gopls version: v0.12.0
How to reproduce
- Clone and open the delve project (github.com/go-delve/delve). There should be no diagnostics.
- Open one of the files in
_fixtures. Gopls is publishing ~570 compiler errors (mostly, DuplicateDecl)
- Close the file. The diagnostics don't go away.
The directory _fixtures contain various files used for debugging. Depending on debugging scenario, mostly a single file is chosen to be built and debugged by tests. They are like testdata.
According to the go command line doc https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns files in this directory are handled specially. But gopls's behavior doesn't seem to align with it.
Directory and file names that begin with "." or "_" are ignored by the go tool, as are directories named "testdata".
I'd appreciate completion or single file mode diagnostics on the files, but not DuplicateDecl diagnostics.
Alternatives to consider
- Provide an option to disable diagnostics on files in certain directories. -> Should this be editor's option?
- Unpublish diagnostics once the files in _fixtures are all closed. -> Still distracting.
- Ask users to use build tags. (
//go:build ignore) -> at least, for delve, this will be a huge change since most tests are sensitive to file line number changes (e.g. setting breakpoint).
Gopls version: v0.12.0
How to reproduce
_fixtures. Gopls is publishing ~570 compiler errors (mostly, DuplicateDecl)The directory
_fixturescontain various files used for debugging. Depending on debugging scenario, mostly a single file is chosen to be built and debugged by tests. They are liketestdata.According to the go command line doc https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns files in this directory are handled specially. But gopls's behavior doesn't seem to align with it.
I'd appreciate completion or single file mode diagnostics on the files, but not DuplicateDecl diagnostics.
Alternatives to consider
//go:build ignore) -> at least, for delve, this will be a huge change since most tests are sensitive to file line number changes (e.g. setting breakpoint).