go/internal/lsp/source
Rebecca Stambler 7beb506c84 internal/lsp: improve errors in multi-module workspaces (GO111MODULE=on)
Currently, when a user opens a workspace with no top-level module but
multiple modules in subdirectories, gopls treats that as an invalid
build configuration and reports an error message that may be difficult
for the user to understand (a go list error message about creating a
main module in the top-level directory). Instead, show a more useful
error message about the gopls workspace layout in both the progress bar
and as a diagnostic on every open file.

This fix only works for GO111MODULE=on (for now) because it's a lot
easier to interpret user intent, and the go command will return no
packages. The next step will be to improve error messaging for
GO111MODULE=auto and for users with nested modules.

Updates golang/go#42109

Change-Id: I702ca6745f7e080ff6704ade7843972ab469ccf3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/272346
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2020-12-01 20:46:55 +00:00
..
completion internal/lsp: offer type converted completion candidates 2020-11-30 20:04:59 +00:00
genapijson internal/lsp/source: use 'gopls.' instead of 'gopls_' 2020-10-20 14:19:29 +00:00
api_json.go internal/lsp: fix misspelling in Codelens option 2020-11-30 17:56:50 +00:00
call_hierarchy.go internal/lsp/source: handle a possible nil pointer in call hierarchy 2020-10-09 16:22:40 +00:00
code_lens.go gopls: add "go test" code action 2020-10-13 16:52:01 +00:00
command.go internal/lsp: use the go command to fix go.mod files 2020-10-28 22:47:54 +00:00
comment.go
comment_test.go
diagnostics.go internal/lsp: track diagnostics by reporting source 2020-11-24 15:22:09 +00:00
extract.go internal/lsp: fix some incorrect spelling 2020-11-24 11:59:21 +00:00
folding_range.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
format.go internal/lsp: fix end positions for multi-line comments with CRLF lines 2020-11-18 03:03:13 +00:00
format_test.go internal/lsp: reproduce and fix golang/go#41057 2020-09-02 22:40:51 +00:00
gc_annotations.go internal/lsp: elide details for non-package files 2020-10-30 01:04:31 +00:00
highlight.go internal/lsp: fix some incorrect spelling 2020-11-24 11:59:21 +00:00
hover.go internal/lsp: add ?utm_source=gopls to links to pkg.go.dev 2020-11-16 00:15:58 +00:00
identifier.go internal/lsp: fix godef for embedded type aliases 2020-11-23 15:59:28 +00:00
identifier_test.go internal/lsp: fix some incorrect spelling 2020-11-24 11:59:21 +00:00
implementation.go internal/lsp/source: move completion to its own package 2020-09-08 19:19:08 +00:00
options.go internal/lsp: fix misspelling in Codelens option 2020-11-30 17:56:50 +00:00
options_test.go internal/lsp: fix misspelling in Codelens option 2020-11-30 17:56:50 +00:00
references.go internal/lsp: disable support for symlinks pending decision 2020-12-01 05:30:39 +00:00
rename.go internal/lsp: do not rename in compiler directive comments 2020-11-03 16:52:30 +00:00
rename_check.go internal/lsp/source: handle nil pointer in rename_check.go 2020-10-23 17:41:41 +00:00
signature_help.go internal/lsp/source: respect user's hover kind in signature help 2020-10-29 22:52:41 +00:00
source_test.go gopls, internal/lsp: support fillstruct for partially-filled structs 2020-11-30 20:22:45 +00:00
symbols.go internal/lsp: don't show blank identifiers in outline 2020-10-09 01:09:51 +00:00
types_format.go internal/lsp/source: respect user's hover kind in signature help 2020-10-29 22:52:41 +00:00
util.go internal/lsp: disable support for symlinks pending decision 2020-12-01 05:30:39 +00:00
view.go internal/lsp: improve errors in multi-module workspaces (GO111MODULE=on) 2020-12-01 20:46:55 +00:00
workspace_symbol.go Revert "internal/lsp/source: simplify workspace symbol package collection" 2020-12-01 01:28:06 +00:00
workspace_symbol_test.go internal/lsp/source: support some fzf-like tokens in symbol matching 2020-09-08 16:35:05 +00:00