go/internal/lsp
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
..
analysis all: fix spelling 2022-04-04 19:50:34 +00:00
browser
cache gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00
cmd internal/lsp: add semantic tokens for arrows in declarations 2022-04-07 14:52:22 +00:00
command gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00
debug internal/lsp/debug: add go version to gopls version output 2022-02-07 15:39:03 +00:00
diff
fake gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00
fuzzy gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00
helper internal/lsp/protocol: update LSP definitions and stubs 2021-10-05 16:44:45 +00:00
lsppos gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00
lsprpc all: fix spelling 2022-04-04 19:50:34 +00:00
mod internal/lsp: add hover for go.work use statements 2022-03-04 19:55:36 +00:00
progress gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00
protocol internal/lsp/protocol: avoid replying with non-nil interface values in case of error 2022-04-13 01:06:48 +00:00
regtest gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00
snippet
source gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00
template gopls, internal/lsp: gofmt 2022-04-12 17:41:31 +00:00
testdata internal/lsp: add semantic tokens for arrows in declarations 2022-04-07 14:52:22 +00:00
tests internal/lsp: add support for formatting go.work files 2022-02-15 17:15:32 +00:00
work internal/lsp: remove unused code 2022-03-17 13:53:41 +00:00
README.md
call_hierarchy.go
code_action.go internal/lsp: honor the file kind provided by clients for overlays 2022-01-13 20:54:45 +00:00
code_lens.go internal/lsp: honor the file kind provided by clients for overlays 2022-01-13 20:54:45 +00:00
command.go internal/lsp: run go mod vendor exclusively to avoid file contention 2022-04-11 22:06:59 +00:00
completion.go internal/lsp: add completion for use directives 2022-03-10 23:20:43 +00:00
completion_test.go
debounce.go internal/lsp: adopt bcmills' suggestion for an improved debouncer API 2021-07-13 16:40:23 +00:00
debounce_test.go internal/lsp: adopt bcmills' suggestion for an improved debouncer API 2021-07-13 16:40:23 +00:00
definition.go internal/lsp: honor the file kind provided by clients for overlays 2022-01-13 20:54:45 +00:00
diagnostics.go internal/lsp: report diagnostics on go.work files 2022-03-04 18:29:58 +00:00
folding_range.go
format.go internal/lsp: add support for formatting go.work files 2022-02-15 17:15:32 +00:00
general.go gopls: upgrade staticcheck to v0.3.0 2022-04-07 14:59:24 +00:00
highlight.go internal/lsp: honor the file kind provided by clients for overlays 2022-01-13 20:54:45 +00:00
hover.go internal/lsp: add hover for go.work use statements 2022-03-04 19:55:36 +00:00
implementation.go
link.go internal/lsp: remove unused parameters from moduleAtVersion 2022-04-04 16:32:51 +00:00
lsp_test.go internal/lsp: use placeholders with prepare rename 2022-02-15 00:29:01 +00:00
references.go internal/lsp: honor the file kind provided by clients for overlays 2022-01-13 20:54:45 +00:00
rename.go internal/lsp: use placeholders with prepare rename 2022-02-15 00:29:01 +00:00
reset_golden.sh
semantic.go internal/lsp: add semantic tokens for arrows in declarations 2022-04-07 14:52:22 +00:00
server.go
server_gen.go internal/lsp: update LSP stubs, including provisional InlayHints 2022-03-16 22:16:36 +00:00
signature_help.go
symbols.go internal/lsp: honor the file kind provided by clients for overlays 2022-01-13 20:54:45 +00:00
text_synchronization.go internal/lsp: signal diagnostic completion if modification failed 2021-07-13 20:49:08 +00:00
workspace.go internal/lsp: remove unused code 2022-03-17 13:53:41 +00:00
workspace_symbol.go

README.md

lsp

internal/lsp provides much of the Language Server Protocol (lsp) implementation for gopls.

Documentation for users and contributors can be found in the gopls/doc directory.