mirror of https://github.com/golang/go.git
Add support in gopls for working on "standalone main files", which are Go source files that should be treated as standalone packages. Standalone files are identified by a specific build tag, which may be configured via the new standaloneTags setting. For example, it is common to use the directive "//go:build ignore" to colocate standalone files with other package files. Specifically, - add a new loadScope interface for use in snapshot.load, to add a bit of type safety - add a new standaloneTags setting to allow configuring the set of build constraints that define standalone main files - add an isStandaloneFile function that detects standalone files based on build constraints - implement the loading of standalone files, by querying go/packages for the standalone file path - rewrite getOrLoadIDsForURI, which had inconsistent behavior with respect to error handling and the experimentalUseInvalidMetadata setting - update the WorkspaceSymbols handler to properly format command-line-arguments packages - add regression tests for LSP behavior with standalone files, and for dynamic configuration of standalone files Fixes golang/go#49657 Change-Id: I7b79257a984a87b67e476c32dec3c122f9bbc636 Reviewed-on: https://go-review.googlesource.com/c/tools/+/441877 gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> |
||
|---|---|---|
| .. | ||
| design | ||
| advanced.md | ||
| analyzers.md | ||
| command-line.md | ||
| commands.md | ||
| contributing.md | ||
| daemon.md | ||
| emacs.md | ||
| features.md | ||
| generate.go | ||
| generate_test.go | ||
| inlayHints.md | ||
| semantictokens.md | ||
| settings.md | ||
| subl.md | ||
| troubleshooting.md | ||
| vim.md | ||
| workspace.md | ||