[gopls-release-branch.0.5] all: merge master into gopls-release-branch.0.5

23787c00 internal/lsp: fix race condition in diagnostics show message
6652d1fb internal/gocommand: add a GoVersion function to avoid duplicating logic
d105bfab internal/lsp: dynamically register semantic tokens
2cbe144a internal/lsp: return code lenses in a deterministic order
eb9088fa internal/lsp/source: remove workspace module from all experiments
2be66b66 cmd/toolstash: pass -S=2 when comparing toolchains
c12dc663 gopls: regtest to demonstrate gopls confused by //line directives
d49c4edd internal/lsp: do not allow non-Go files to be loaded in packages.load
226fd2f8 internal/lsp/fake: factor out working in a temp directory
90550980 internal/lsp/source: use 'gopls.' instead of 'gopls_'
f5c826d1 internal/lsp: hold notifications until gopls is initialized
b894a329 all: use explicit -mod, -modfile fields for gocommand.Invocation
0a3dcccd internal/lsp/source: add a FileSource interface
b2746f1d internal/lsp: fix nil pointer exception in initialization
6003fad6 internal/lsp/source: delete unused Snapshot.IsSaved
a03874c3 internal/lsp: clean up unused parameters
2d76fa4f gopls/internal/regtest: delete OpenFileWithContent
593bd9b1 internal/lsp/cache: delay transitive invalidation in snapshot.clone
e52f5410 internal/lsp: fix analysis in all experiments, disable unusedparams
eae18abd internal/lsp/cache: factor out guessPackagesForURI from snapshot.clone
de28cda0 internal/lsp: remove staticcheck and gofumpt from all experiments
a78bdc4e x/tools/go/analysis/passes/unsafeptr: report Header misuse
255fb2ad x/tools/go/analysis/passes/unsafeptr: stricter reporting
a2250d31 internal/lsp: add gopls semtok command and semantic token tests
7c89c52d x/tools/gopls: add a skipped test for renaming of package
c9011902 internal/lsp/source/genapijson: add 'gopls_' prefix to commands
a5d9e455 internal/lsp/source: be consistent about command identifiers
b29caf79 internal/lsp/source: include setting name in all settings errors
828e89dd internal/lsp: fix env setting type
6e6f73a5 internal/lsp: fix mismatches between doc and settings
1610a49f internal/lsp/source/completion: use a minimum budget of 10ms for shallow completions
d1624618 go/analysis/passes/asmdecl: add support for ABI selector clauses
64a9e34f internal/imports: dedupe import paths for standard library packages
c16b75f9 internal/imports: bump relevance for modules with higher major versions
0112737e gopls/internal/regtest: add a test for switching from modules to GOPATH
d88ec18c go/analysis: add IgnoredFiles, check ignored files in buildtag check
67cabf80 go/loader: delete example_test.go
8c269738 gopls: add "go test" code action
2db1cd79 internal/lsp: extract mod errors in load and treat them like diagnostics
ec925d8b gopls/internal/regtest: add a failing test for swig
5bd05386 internal/lsp: move the workspaceMode into the snapshot
ed2f5020 internal/lsp/semantic.go: generate semantic tokens
6e5c6d77 internal/lsp: handle nil pointer in semantic tokens
fcf82128 internal/lsp/source: handle a possible nil pointer in call hierarchy
96877f28 internal/lsp, gopls: require a "gopls_" prefix on all commands
9ab7e515 internal/lsp: don't show blank identifiers in outline
7ddb464c internal/lsp: add "type "  to hover messages for structs/interfaces/etc
d01b322e internal/lsp/cache: extract goimports code
4c6f507b gopls/doc: use enum value docstrings, if they exist
ffec9784 internal/lsp: handle major versions above v0/v1 in workspace module mode
03e951c4 internal/lsp/source: add an experimental new cache key for packages
9df69603 internal/lsp: don't pass build flags to `go mod` commands
0806396f internal/lsp: don't show an error for "allExperiments" in (options).set
d5f20aad gopls: add regtest mode for experiments, like workspace module tests
45061abf internal/lsp: add support for an "enable all experiments" settings
a00137c5 internal/lsp: default to workspace module mode even with vendor dirs
454bc3d4 internal/lsp/source: show references to interface methods
23a3aa10 internal/lsp: improve handling of files not in views
567bb5a4 go/analysis/analysistest: fix issue in RunWithSuggestedFixes on a package with tests
90a82dd3 internal/lsp/cache: actually remove the view's modURI and sumURI
576e169c internal/lsp: fix hover for builtin error method (Error)
1ccce621 internal/lsp/cache: prevent version from including line break
9854aba0 internal/lsp: unconditionally create changedFiles map
ecd9fd27 internal/lsp/source: ignore empty package names for completion
39ee293a gopls: add test for `go mod tidy` diagnostics in multiple modules
76a79a66 internal/lsp/source: factor out enum options pattern
7e5cd543 internal/lsp/source: improve documentation for symbolStyle
08f19738 gopls/internal/regtest: only run in singleton mode
22683886 internal/lsp: fix go.mod creation without experimental workspace module
8445f4f0 internal/lsp: add experimental support for multi-phase diagnostics
0d28ed0c gopls: add a test that mirrors govim's -mod=readonly test
b5b87423 internal/lsp/source: refactor c.item to support deepSearch in all cases
4e032a7e internal/lsp: fix and add a test for non-workspace module mode
dc8b4bac internal/lsp: fix two more staticcheck warnings
af0a1b5f internal/lsp: fix staticcheck warning
41c411d7 internal/lsp/testdata: remove diagnostic from percent package
77e61d32 internal/lsp/source: remove unused Session method
1e3611d2 internal/lsp: remove logic for re-creating a view when a go.mod changes
43ebab89 gopls/doc: fix section rewriting
e57f6d46 internal/lsp: move hasValidBuildConfiguration into the snapshot
2e5f0cfa internal/lsp: remove all but one use of the view's modURI field
a6f32d17 gopls/internal/regtest: allow cleanup to fail on windows
a44386fa internal/lsp/source/completion: use c.matcher for comments
66e72d03 internal/lsp: print the go version only once the view is created
c8c0a1c0 internal/lsp/semantic.go: add the skeleton for supporting semantic tokens
bf155c11 internal/lsp: use published diagnostics instead of reports in lsp_test
bce87a78 internal/lsp/source/completion: remove unused contexts
c43c25c9 internal/lsp/source: run deep completions before unimported completions
f1e51e6b internal/lsp: stop using modURI as much as possible
fc8742f9 cmd/bundle: expand test coverage to all modes
5272f303 gopls: fix various staticcheck errors
ffa3839b cmd/bundle: use caller's module version via go/packages
d7fc70ab gopls/internal/regtest: always await InitialWorkspaceLoad
a0ef9b62 internal/lsp: prepare for deletion of view.modURI
19e03678 internal/lsp/cache: use gopls.mod for the workspace module if it exists
50ab9675 internal/lsp/source: add additional generated docs
42b62fc9 gopls/internal/regtest: fix data race when printing logs
5d1fdd8f internal/lsp: allow multiple go.mod files in a view
e8435508 internal/lsp: run marker tests in multi-module mode
4c77dbd9 internal/lsp: fix race condition caused by config in `go mod tidy`
34b80a0a gopls/doc: update and expand the nvim documentation
0eae6ac9 internal/lsp: add a test for gc annotation details code lens
8d73f178 internal/lsp: move package selection to before type checking

Change-Id: If6de848f3d37deda28273b0b75dce2425fd1fe5d
tree: 3910133167672048016e131a9acaafdbd7e6ac2b
  1. benchmark/
  2. blog/
  3. cmd/
  4. container/
  5. cover/
  6. go/
  7. godoc/
  8. gopls/
  9. imports/
  10. internal/
  11. playground/
  12. present/
  13. refactor/
  14. txtar/
  15. .gitattributes
  16. .gitignore
  17. .prettierrc
  18. AUTHORS
  19. codereview.cfg
  20. CONTRIBUTING.md
  21. CONTRIBUTORS
  22. go.mod
  23. go.sum
  24. LICENSE
  25. PATENTS
  26. README.md
README.md

Go Tools

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.

Download/Install

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.

JS/CSS Formatting

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.

Report Issues / Send Patches

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.