go/internal/lsp/lsprpc
Robert Findley 87f47bbfb4 gopls/internal/regtest/bench: refactor and improve benchmarks
Significantly refactor the gopls benchmarks to turn them into proper
benchmarks, eliminate the need for passing flags, and allow running them
on external gopls processes so that they may be used to test older gopls
versions.

Doing this required decoupling the benchmarks themselves from the
regtest.Runner. Instead, they just create their own regtest.Env to use
for scripting operations. In order to facilitate this, I tried to
redefine Env as a convenience wrapper around other primitives.

By using a separate environment setup for benchmarks, I was able to
eliminate a lot of regtest.Options that existed only to prevent the
regtest runner from adding instrumentation that would affect
benchmarking. This also helped clean up Runner.Run somewhat, though it
is still too complicated.

Also eliminate the unused AnyDiagnosticAtCurrentVersion, and make a few
other TODOs about future cleanup.

For golang/go#53992
For golang/go#53538

Change-Id: Idbf923178d4256900c3c05bc8999c0c9839a3c07
Reviewed-on: https://go-review.googlesource.com/c/tools/+/419988
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 14:58:59 +00:00
..
autostart_default.go gopls: remove usage of golang.org/x/xerrors 2022-04-20 15:33:22 +00:00
autostart_posix.go gopls: remove usage of golang.org/x/xerrors 2022-04-20 15:33:22 +00:00
binder.go gopls: remove usage of golang.org/x/xerrors 2022-04-20 15:33:22 +00:00
binder_test.go internal/lsp/lsprpc: use middleware for the V2 handshaking 2021-07-02 16:14:25 +00:00
commandinterceptor.go internal/lsp/lsprpc: add a CommandInterceptor middleware 2021-07-02 16:14:40 +00:00
commandinterceptor_test.go internal/lsp/lsprpc: add a CommandInterceptor middleware 2021-07-02 16:14:40 +00:00
dialer.go gopls: remove usage of golang.org/x/xerrors 2022-04-20 15:33:22 +00:00
goenv.go internal/lsp/lsprpc: only propagate explicit GOWORK when using remote 2022-04-01 20:25:27 +00:00
goenv_test.go internal/lsp/lsprpc: add a goenv middleware 2021-07-02 16:14:50 +00:00
lsprpc.go gopls/internal/regtest/bench: refactor and improve benchmarks 2022-08-04 14:58:59 +00:00
lsprpc_test.go gopls/internal/regtest/bench: refactor and improve benchmarks 2022-08-04 14:58:59 +00:00
middleware.go gopls: remove usage of golang.org/x/xerrors 2022-04-20 15:33:22 +00:00
middleware_test.go internal/lsp/lsprpc: use middleware for the V2 handshaking 2021-07-02 16:14:25 +00:00