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

Unexpected errors on didOpen and didChange, LSP entirely not working. #1296

Closed
AlexSWall opened this issue May 12, 2022 · 2 comments · Fixed by #1298
Closed

Unexpected errors on didOpen and didChange, LSP entirely not working. #1296

AlexSWall opened this issue May 12, 2022 · 2 comments · Fixed by #1298
Labels
bug Something isn't working

Comments

@AlexSWall
Copy link

Describe the bug
Starting my text editor (neovim) with the LSP attached immediately gives me an error of the form

LSP[erlangls]: Error INVALID_SERVER_MESSAGE: {
  error = {
    code = -32001,
    message = "Unexpected error while textDocument/didOpen"
  },
  jsonrpc = "2.0"
}

and I get the same but with didChange instead of didOpen on typing anything. Every other LSP is working with the same setup so I believe it to be specific to erlang_ls.

To Reproduce
I am simply opening the text editor with the LSP attached.

Context

  • erlang_ls version (tag/sha): cfab726
  • Editor used: neovim v0.7 (on Ubuntu 18.04).
  • LSP client used: nvim-lspconfig (latest)

You can see my server.log here.

@AlexSWall AlexSWall added the bug Something isn't working label May 12, 2022
@robertoaloi
Copy link
Member

What I think is happening is that the IDE is sending a didOpen request for a file which is not (yet?) readable from disk. I checked the specs and they are very clear in the sense that the language server should not try to access the file from disk:

The server must not try to read the document’s content using the document’s Uri.

Erlang LS erroneously does that. I will prepare a fix and ping you once it's available, so you can try if it works.

Thanks for reporting @AlexSWall !

@AlexSWall
Copy link
Author

Yep, seems like that fixed it, thanks!

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