Eli Zaretskii <eliz@gnu.org> writes:
It doesn't take too many "botched eglot ranges" interacting with slow
`thingatpt' misbehavior to add up to a 10s delay.
ACK.
I'm not certain of the best solution. A few ideas, from hardest to easiest:
Teach eglot textDocument/diagnostic
++++++++++++++++++++++++++++
textDocument/publishDiagnostics messages arrive way too frequently IMO, after every buffer change of any
kind. They are pushed to eglot from the LSP server, and if they contain hundreds of errors, this becomes
very inefficient (re-painting with flymake the same hundreds of regions over and over after each keystroke).
The best solution here would probably be to adopt "pull" diagnostics using textDocument/diagnostic, perhaps
in an idle-timer whose duration the user can configure. I don't believe EGLOT can do diagnostic pulls at the
moment.
You're right it can't. A patch that implements without much code
repetition and keeps support for the "push" diagnostics model is
welcome. Would you like to work on it, JD?
As far as I understand, this model is much more complicated and allows
you to pull diagnostics for individual LSP documents or the whole
project. One of the difficulties I envison is to do it in a way that
maintains support for project-wide diagnostics.
But its certainly not impossible and would be a wonderful addition,
fixing many problems such as
https://github.com/joaotavora/eglot/issues/1296.