Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP :: invalid params of textDocument/codeAction: expected array for /context/diagnostics[0]/relatedInformation [6 times] #46

Closed
szobov opened this issue Apr 21, 2019 · 2 comments

Comments

@szobov
Copy link

szobov commented Apr 21, 2019

Hi there!

I've tried to use ccls with spacemacs, but everytime I put a cursor on line with error I receive:

LSP :: invalid params of textDocument/codeAction: expected array for /context/diagnostics[0]/relatedInformation [N times] (N is a count of how many times I put a cursor on line with the error).

This is my system env, hope it helps:

#### System Info :computer:
- OS: gnu/linux
- Emacs: 26.1
- Spacemacs: 0.300.0
- Spacemacs branch: develop (rev. 2206095be)
- Graphic display: nil
- Distribution: spacemacs
- Editing style: vim
- Completion: helm
- Layers:
```elisp
(csv systemd ruby multiple-cursors rust helm emacs-lisp neotree graphviz auto-completion syntax-checking version-control spell-checking restclient git github ansible docker nginx sql markdown yaml protobuf shell windows-scripts python erlang elixir
     (c-c++ :variables c-c++-default-mode-for-headers 'c++-mode c-c++-backend 'lsp-ccls c-c++-lsp-executable "/home/szobov/.nix-profile/bin/ccls" c-c++-lsp-sem-highlight-method 'font-lock c-c++-lsp-cache-dir "/home/szobov/.ccls-cache-dir/")
     semantic cmake html javascript typescript react
     (go :variables go-use-gometalinter t go-use-test-args "-race -timeout 30s -v" godoc-at-point-function 'godoc-gogetdoc)
     nixos evernote emoji)
- System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES THREADS

I can also provide any important information if you need.
Thanks!

@szobov
Copy link
Author

szobov commented May 13, 2019

ping

@MaskRay
Copy link
Member

MaskRay commented May 13, 2019

Your lsp-mode may be older than emacs-lsp/lsp-mode#691 . Before that an empty JSON array was (de)serialized as nil. That badly conflicted with the JSON null.

I suspect "relatedInformation":[] (from textDocument/publishDiagnostics) was deserialized as (:relatedInformation nil), and then it was passed around as "relatedInformation": null by lsp-execute-code-action. That was incorrect. The spec says:

relatedInformation?: DiagnosticRelatedInformation[];

relatedInformation can't be a null.

@MaskRay MaskRay closed this as completed May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants