go/internal/lsp/protocol
Bryan C. Mills b7d757405f internal/lsp/protocol: avoid replying with non-nil interface values in case of error
The JSON-RPC 2.0 protocol requires that responses objects
have either a "result" or an "error", but not both.
In Go, this corresponds to a non-nil result interface value or a
non-nil error.

However, the generated wrappers for the LSP protocol were passing
non-nil values for both in case of error, due to passing typed-nil
pointers as (non-nil) interfaces (see
https://go.dev/doc/faq#nil_error).

This change fixes the generator to explicitly pass only one or the
other, and re-runs the generator at the existing commit.

For golang/go#49387
For golang/go#46520

Change-Id: I582b52820bdac15d9f947e8d6c1e9daa70c53e40
Reviewed-on: https://go-review.googlesource.com/c/tools/+/388600
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-13 01:06:48 +00:00
..
typescript internal/lsp/protocol: avoid replying with non-nil interface values in case of error 2022-04-13 01:06:48 +00:00
codeactionkind.go gopls: add "go test" code action 2020-10-13 16:52:01 +00:00
context.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
doc.go
enums.go
log.go all: add copyright notices to files that are missing them 2021-01-06 17:23:47 +00:00
protocol.go internal/lsp/protocol: ignore reply values with non-nil errors in jsonrpc2_v2 adapters 2022-04-12 20:21:55 +00:00
span.go internal/lsp: eliminate funcs from commands, and refactor 2021-02-09 22:07:08 +00:00
tsclient.go internal/lsp/protocol: avoid replying with non-nil interface values in case of error 2022-04-13 01:06:48 +00:00
tsprotocol.go internal/lsp/protocol: avoid replying with non-nil interface values in case of error 2022-04-13 01:06:48 +00:00
tsserver.go internal/lsp/protocol: avoid replying with non-nil interface values in case of error 2022-04-13 01:06:48 +00:00