1

After configuring neovim with mason, mason-lspconfig, nvim-lspconfig, null-ls, and mason-null-ls and installing the gopls lsp server, I recently started getting this error upon opening a go file.

In plain text:

RPC[Error] code_name = ParseError, message = "JSON RPC parse error: json: cannot unmarshal object into Go struct field PCompletionListPCompletion.capabilities.textDocument.completion.completionList.itemDefaults of type []string"

When I run :LspInfo I see that null-ls is attached to the current buffer and that gopls is recognized as being "available," but gopls won't attach to the buffer (filetypes, root directory and cmd all look correct).

My configuration can be found here.

After searching, I have found many supposed fixes for gopls ~v0.6 in relation to json parse errors, but they do not seem applicable.

My gopls version is v0.10.1 and goplz api-json seems to print correctly.

1 Answer 1

1

Eventually figured this out. Had to run :checkhealth and found several warnings. After fixing all the warnings, removing duplicated go installations on my machine, upgrading to go 1.19 and reinstalling gopls, got it working again.

Not the answer you're looking for? Browse other questions tagged or ask your own question.