1
0
mirror of https://github.com/golang/go synced 2024-10-01 01:38:33 -06:00
go/internal/lsp/cmd
Rebecca Stambler 11affa06ff internal/lsp: show errors when the user is in the wrong directory
If we encounter `go list` errors when loading a user's package, we
should try to see if they've encountered any of our common error cases.
They are: 1) a user has GO111MODULE=off, but is outside of their GOPATH,
and 2) a user is in module mode but doesn't have a go.mod file.

Fortunately, go/packages does a great job handling edge cases so gopls
will work well for most of them. The main issue will be unresolved
imports. These show up in DepErrors in `go list`, so go/packages doesn't
propagate them through to the list of errors. This will require changes
to go/packages.

Updates golang/go#31668

Change-Id: Ibd5253b33b38caffeaad54a403c74c0b861fcc14
Reviewed-on: https://go-review.googlesource.com/c/tools/+/194018
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-09-17 21:41:55 +00:00
..
check_test.go internal/lsp: use protocol.Range in completion items 2019-08-20 20:57:17 +00:00
check.go internal/lsp: use x/xerrors to create new errors 2019-08-06 19:46:56 +00:00
cmd_test.go internal/lsp: enable suggested fixes by default 2019-09-09 19:40:07 +00:00
cmd.go internal/lsp: reduce usage of column mapper 2019-09-16 22:00:07 +00:00
definition_test.go internal/lsp: fix data race in cmd tests 2019-08-13 03:47:49 +00:00
definition.go internal/lsp: show errors when the user is in the wrong directory 2019-09-17 21:41:55 +00:00
export_test.go internal/lsp: refactor query definition test to allow adding a new test 2019-03-18 20:06:54 +00:00
format_test.go internal/lsp: have tests report a different application name to the main gopls binary 2019-07-18 23:01:26 +00:00
format.go internal/lsp: change to protocol.TextEdit for formatting 2019-09-06 17:54:09 +00:00
info.go internal/lsp: move PrintVersionInfo to the debug package 2019-06-03 15:29:06 +00:00
query.go internal/lsp: fix query cmd usage 2019-04-22 18:06:03 +00:00
serve.go x/tools/gopls: reimplement rpc logging at a lower level 2019-08-29 16:05:15 +00:00