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

Sending LSP messages very quickly causes all diagnostics to disappear #812

Closed
tomsmeding opened this issue Dec 11, 2020 · 1 comment · Fixed by haskell/ghcide#959
Closed

Comments

@tomsmeding
Copy link

This is an issue I encounter when using ghcide using ALE in neovim. (However, the issue can be reproduced without any of that; see below.)

Symptom
While working on code (in neovim using ALE), an edit action, as well as a :w save action, has a reasonable probability of removing all diagnostics from the current file. This is especially frequent on save and on pressing ESC to exit insert mode. It can usually be fixed by doing another edit action and undo'ing that, but it is quite annoying nevertheless.

Reproduction
Save this script to a file, say ghcide-fast-send-bug.py, and then run python3 ghcide-fast-send-bug.py fast | ghcide --lsp. Note that the last LSP message printed by ghcide is an empty diagnostic list, while there is certainly still an error in the file.
Removing the fast command-line argument adds a 2-second delay between the last two LSP messages printed by the script (please see the script!), which makes the bug disappear on my machine.

I believe the script should work on any machine, but perhaps things like the root path need to be changed to an existing path on your machine. I'm not familiar enough with the LSP protocol to say something sensible about that.

System
Arch Linux, ghcide manually built on commit 27b4250 (one above v0.6.0, and current HEAD). ghcide was built using cabal 3.2.0.0, ghc version 8.8.4.

@pepeiborra
Copy link
Collaborator

Thanks for the bug report. I have bisected this back to haskell/ghcide@8de10e9 and hopefully will find some time to look into it soon

@pepeiborra pepeiborra transferred this issue from haskell/ghcide Jan 1, 2021
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

Successfully merging a pull request may close this issue.

2 participants