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

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.