not doing that is causing stale diagnostics until the new one are received.
I have been tackling on this behavior lately with ccls and I need to make an extra modification in the buffer and then save it to make the errors disappear. I think if this is solved it will greatly improve the experience of flycheck users.
I have been tackling on this behavior lately with ccls and I need to make an extra modification in the buffer and then save it to make the errors disappear. I think if this is solved it will greatly improve the experience of flycheck users.
This should not happen with the latest lsp-mode. The errors should either disappear after 0.5 seconds after modification or 0.5 after they are received from the server. Unless you have removed on idle from flycheck.
How can I verify the state of flycheck's on idle option you mention? Is there an lsp-mode option that could possibly disable it?
Check if flycheck-check-syntax-automatically has idle-change. Also, doing M-x flycheck-buffer will force lsp-mode to report the latest error reported from the server.
You were right, in my configuration I had the snippet below and after removing it everything works as it should.
elisp
(setq flycheck-check-syntax-automatically '(mode-enabled save))
I will take a look.
Check if flycheck-check-syntax-automatically has idle-change.
Why idle-change must be checked here? There are users like me wish to see diagnostics only after saved.
Check if flycheck-check-syntax-automatically has idle-change.
Why
idle-changemust be checked here? There are users like me wish to see diagnostics only after saved.
That is why this check is here - do not refresh diagnostics on idle if on idle is not on. But indeed, there is a bug here. We should also update the diagnostics if the buffer is saved and user wants to update diags on save. This is what is causing your issues.
Most helpful comment
I have been tackling on this behavior lately with ccls and I need to make an extra modification in the buffer and then save it to make the errors disappear. I think if this is solved it will greatly improve the experience of flycheck users.