1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:44:42 -07:00
go/internal/lsp/cmd
Rob Findley 0fd2d649e6 internal/lsp/lsprpc: add an LSP forwarder and regtest environment
Add a new Forwarder type to the lsprpc package, which implements the
jsonrpc2.StreamServer interface. This will be used to establish some
parity in the implementation of shared and singleton gopls servers.

Much more testing is needed, as is handling for the many edge cases
around forwarding the LSP, but since this is functionally equivalent to
TCP forwarding (and the -remote flag was already broken), I went ahead
and used the Forwarder to replace the forward method in the serve
command. This means that we can now use the combination of -listen and
-remote to chain together gopls servers... not that there's any reason
to do this.

Also, wrap the new regression tests with a focus on expressiveness when
testing the happy path, as well as parameterizing them so that they can
be run against different client/server execution environments. This
started to be sizable enough to warrant moving them to a separate
regtest package. The lsprpc package tests will instead focus on unit
testing the client-server binding logic.

Updates golang/go#36879
Updates golang/go#34111

Change-Id: Ib98131a58aabc69299845d2ecefceccfc1199574
Reviewed-on: https://go-review.googlesource.com/c/tools/+/218698
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
2020-02-14 14:21:06 +00:00
..
test internal/lsp: add codelens for go.mod dependency upgrades 2020-02-14 14:15:08 +00:00
capabilities_test.go internal/lsp: refactor LSP server instantiation 2020-02-06 23:12:37 +00:00
check.go internal/lsp: remove boolean for publishEmpty in diagnostics 2020-01-15 22:25:09 +00:00
cmd_test.go internal/lsp: refactor LSP server instantiation 2020-02-06 23:12:37 +00:00
cmd.go internal/lsp: move all debugging support to the debug package 2020-02-10 18:44:17 +00:00
definition.go internal/lsp: remove useless check 2020-02-03 17:13:28 +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
folding_range.go tools/gopls: add cmd support for folding_ranges 2019-11-12 00:55:09 +00:00
format.go internal/lsp: address staticcheck warnings 2019-10-04 02:16:23 +00:00
highlight.go internal/lsp: add control flow highlighting for functions 2019-12-02 19:01:20 +00:00
implementation.go tools/gopls: add cmd support for implementation 2019-11-25 20:27:09 +00:00
imports.go internal/lsp: fix the return type of CodeAction() 2019-11-19 17:57:05 +00:00
info.go tools/internal/lsp/cmd: fix documentation 2019-12-30 18:10:14 +00:00
links.go tools/gopls: add command line support for links 2019-11-01 17:18:15 +00:00
prepare_rename.go internal/lsp: two trivial cleanups from CL 219077 2020-02-13 21:22:11 +00:00
query.go internal/lsp: improve link in documentation on hover 2019-12-12 22:39:21 +00:00
references.go internal/lsp: propagate errors from find references 2020-01-09 21:23:09 +00:00
rename.go internal/lsp: use span.URI constructor everywhere 2020-01-31 00:08:51 +00:00
serve.go internal/lsp/lsprpc: add an LSP forwarder and regtest environment 2020-02-14 14:21:06 +00:00
signature.go tools/gopls: add cmd support for signature 2019-10-31 22:07:37 +00:00
suggested_fix.go internal/lsp: diagnose the snapshot on every text synchronization event 2020-01-15 23:07:48 +00:00
symbols.go internal/lsp/cmd: fix documentation 2020-01-02 17:13:01 +00:00