| commit | cc330816fc525fad9b23970b8ce0fe83f3dd5512 | [log] [tgz] |
|---|---|---|
| author | Heschi Kreinick <heschi@google.com> | Wed Dec 02 21:06:38 2020 -0500 |
| committer | Heschi Kreinick <heschi@google.com> | Tue Dec 08 18:36:58 2020 +0000 |
| tree | 8492e9abc28e30477cf53231b11603b2253b026e | |
| parent | e652b2f42cc723c83eedb31cfd097d44fbd0809c [diff] |
internal/lsp: support directory inclusion/exclusion filters Users working in large repositories may want to include only selected directories in their workspace to avoid memory usage and performance slowdowns. Add support for inclusion/exclusion filters that control what directories are searched for workspace packages and modules. Packages that are excluded by the filter may still be loaded as non-workspace packages if other things depend on them. For a description of the option's syntax, see the documentation. Note that because we don't have any way to communicate the filters to packages.Load, we still run go list on the unfiltered workspace scope, then throw away the irrelevant packages. That may cost us, especially in workspaces with many files. Comments on the naming welcome. Also, if you know any places I may have missed applying the filter, please do tell. One thing I thought of is file watching, but that's covered because allKnownSubdirs works off of workspace files and those are already filtered. Possible enhancements: - Support glob patterns. - Apply filters during the goimports scan. - Figure out how to apply the filters to packages.Load. I don't know how to do it while still being build system neutral though. Closes golang/go#42473, assuming none of the enhancements are required. Change-Id: I9006a7a361dc3bb3c11f78b05ff84981813035a0 Reviewed-on: https://go-review.googlesource.com/c/tools/+/275253 Trust: Heschi Kreinick <heschi@google.com> Run-TryBot: Heschi Kreinick <heschi@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
This subrepository holds the source for various packages and tools that support the Go programming language.
Some of the tools, godoc and vet for example, are included in binary Go distributions.
Others, including the Go guru and the test coverage tool, can be fetched with go get.
Packages include a type-checker for Go and an implementation of the Static Single Assignment form (SSA) representation for Go programs.
The easiest way to install is to run go get -u golang.org/x/tools/.... You can also manually git clone the repository to $GOPATH/src/golang.org/x/tools.
This repository uses prettier to format JS and CSS files.
The version of prettier used is 1.18.2.
It is encouraged that all JS and CSS code be run through this before submitting a change. However, it is not a strict requirement enforced by CI.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the tools repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/tools/(your subdir):” in the subject line, so it is easy to find.