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> |
||
|---|---|---|
| .. | ||
| completion | ||
| add_import.go | ||
| api_json.go | ||
| call_hierarchy.go | ||
| code_lens.go | ||
| comment.go | ||
| comment_go118.go | ||
| comment_go118_test.go | ||
| diagnostics.go | ||
| extract.go | ||
| fix.go | ||
| folding_range.go | ||
| format.go | ||
| format_test.go | ||
| gc_annotations.go | ||
| highlight.go | ||
| hover.go | ||
| identifier.go | ||
| identifier_test.go | ||
| implementation.go | ||
| inlay_hint.go | ||
| known_packages.go | ||
| options.go | ||
| options_test.go | ||
| references.go | ||
| rename.go | ||
| rename_check.go | ||
| signature_help.go | ||
| source_test.go | ||
| stub.go | ||
| symbols.go | ||
| types_format.go | ||
| util.go | ||
| util_test.go | ||
| view.go | ||
| workspace_symbol.go | ||
| workspace_symbol_test.go | ||