Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Problems integrating with the Elm language server #1573

Closed
hovsater opened this issue Jan 24, 2022 · 5 comments
Closed

Problems integrating with the Elm language server #1573

hovsater opened this issue Jan 24, 2022 · 5 comments
Labels
A-language-server Area: Language server client C-bug Category: This is a bug upstream

Comments

@hovsater
Copy link
Contributor

hovsater commented Jan 24, 2022

When writing Elm code, sometimes the LSP integration becomes erratic/broken and generates diagnostics for problems that don't exist. E.g., only partially interpreting identifiers, generating parsing errors and what not. Initially I thought it was due to incremental synchronziation, see elm-tooling/elm-language-server#503, but I don't believe that's the case any more.

Video of me making some edits and saving the file, triggering a formatting request.
https://asciinema.org/a/dexV5nWbBn5sQ9iDRD5X2r9qB and here's the associated log.

Vide of me making some edits and saving the file. Then manually triggering formatting.
https://asciinema.org/a/Bh47XkiludVBgxK6U8b5LuJal and here's the associated log.

The videos above were recorded using the master build of Helix, Elm 0.19.1, elm-language-server 2.4.0 and Node v17.3.0.

I've reported the issue to elm-language-server as well.

@kirawi kirawi added A-language-server Area: Language server client C-bug Category: This is a bug upstream labels Jan 24, 2022
@hovsater
Copy link
Contributor Author

I just tried to replicate the videos above in Sublime Text but failed to do so. I do not get the parsing error diagnostic when performing the same operations in Sublime Text.

@archseer
Copy link
Member

Does this only happen from formatting? Or can you replicate only by typing too?

@hovsater
Copy link
Contributor Author

I have not been able to reproduce it when formatting isn't taking place.

@archseer
Copy link
Member

There's also #1364, maybe we need to double check our formatting implementation.

@archseer
Copy link
Member

Could it be that the Elm LSP isn't expecting text/didChange from formatting changes?

In your logs, this is the changes we get from the formatting request

2022-01-23T17:59:48.184 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"result":[{"newText":"","range":{"start":{"line":47,"character":0},"end":{"line":47,"character":8}}},{"newText":"\n           ","range":{"start":{"line":48,"character":16},"end":{"line":48,"character":16}}}]}

Then we apply them and report them back

2022-01-23T17:59:48.198 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":8,"line":47},"start":{"character":0,"line":47}},"text":""},{"range":{"end":{"character":16,"line":48},"start":{"character":16,"line":48}},"text":"\n           "}],"textDocument":{"uri":"file:///Users/kevinsjoberg/code/shape_matcher/src/Main.elm","version":22}}}

The changes seem identical to me to what we got from the LSP so I don't see how helix could be wrong.

@helix-editor helix-editor locked and limited conversation to collaborators Apr 8, 2024
@pascalkuthe pascalkuthe converted this issue into discussion #10274 Apr 8, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
A-language-server Area: Language server client C-bug Category: This is a bug upstream
Projects
None yet
Development

No branches or pull requests

3 participants