Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/lsp/protocol: ignore reply values with non-nil errors in jso…
…nrpc2_v2 adapters The documentation for jsonrpc2.Replier states that “[i]f err is set then result will be ignored.” jsonrpc2_v2 documents no such affordance, and the JSON-RPC 2.0 protocol explicitly requires that the result “MUST NOT exist if there was an error invoking the method.” Although CL 388600 already avoids returning values in case of error (which may also help with escape analysis and/or allocation efficiency), it seems simplest and least confusing to make the semantic difference between the jsonrpc2.Handler and jsonrpc2_v2.Handler explicit in the code. For golang/go#46520. Change-Id: If13eb842505d42cbc51c01f5f5e699a549a3a28b Reviewed-on: https://go-review.googlesource.com/c/tools/+/400054 Run-TryBot: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]> gopls-CI: kokoro <[email protected]> Reviewed-by: Robert Findley <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
- Loading branch information