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

"expected either either a list of a %GenLSP.Structures.SymbolInformation{}, a list of a %GenLSP.Structures.DocumentSymbol{}, or null or a %GenLSP.ErrorResponse{}" #485

Closed
teamon opened this issue May 17, 2024 · 1 comment · Fixed by #489
Labels
bug Something isn't working

Comments

@teamon
Copy link

teamon commented May 17, 2024

I got this error:

** (MatchError) no match of right hand side value: {:error, "expected either either a list of a %GenLSP.Structures.SymbolInformation{}, a list of a %GenLSP.Structures.DocumentSymbol{}, or null or a %GenLSP.ErrorResponse{}"}
    (gen_lsp 0.8.1) lib/gen_lsp.ex:418: GenLSP.dump!/2
    (gen_lsp 0.8.1) lib/gen_lsp.ex:291: anonymous fn/6 in GenLSP.loop/3
    (gen_lsp 0.8.1) lib/gen_lsp.ex:397: GenLSP.attempt/4
    (stdlib 5.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3



[Error - 15:47:30] LSP Exited.
  • NextLS v0.22.4

These errors happen during formatter run, which then prevents the file from being saved (in vscode).

Would it be possible to make the next-ls somehow resilient and keep working in case of any error instead of crashing?

@mhanberg
Copy link
Collaborator

I ran into this bug the other day, forgot to open an issue, but am working on a fix.

So two issues here:

  • the actual bug of the document symbols returning a value that is not spec compliant
  • determining if validation of spec inputs and outputs should result in the server crashing. previously i had it as it should crash, but being resilient to the improper data is probably more convenient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants