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
flymake-no-change-timeout setting seems to be ignored #508
Comments
Do you actually see these diagnostics that come in periodically displayed on screen? The reason why I'm asking is that Flymake, or at least that particular Flymake variable, has no control over the amount of information that the LSP server sends to Emacs or vice versa. In normal LSP situations, everytime Emacs communicates a change to a file, the LSP server volunteers information about diagnostics. That seems to be what you're showing me in that transcript. |
It is server responsibility to send |
Yeah, I guess there's something in Eglot that can suggest to the LSP server that they shouldn't do that. Some capability . Maybe tweaking |
Nope, scrolled right past them to be honest. I guess my understanding of how LSP works is rather limited which is why I thought this could be easily configured client-side. Well, maybe I can figure something out tinkering with that variable you mentioned ( |
Hello, I'd also like to add to this issue. From the discussion I can understand that the server will volunteer to check diagnostics on change. However, is there a way for eglot to "hold on" to them, and only displays them when flymake asks for it (e.g. via the timeout timer, or manual activation)? |
This pull request (#957) seems to add the functionality. |
I think this is what happens currently. If it isn't and you have all necessary elements to elaborate an issue (this includes a way for me to witness), please do so. |
See my reply on #957. The Flymake diagnostic update you're seeing are for the same "ongoing" check that you have started (presumably manually, if you set it If you'd like to completely disable Flymake diagnostics, if you'd like to get diagnostics only on request, I don't think LSP has a good model for that. |
Thanks for the prompt reply! I'll try to describe what I experienced: With clangd in a c project, I set I've set I suspect that company asking for completion would manually send changes to the LSP server, so I agree it seems LSP does not have a good model for that. Just wondering, as a client, can eglot do something about this? For example, with the option to only show the diagnostics once and suppress the following notifications, until flymake asks again? Thanks a lot for your help!
|
See the commit message for rationale and details. |
Also per joaotavora/eglot#957. Only actually and eagerly report LSP diagnotics if the user has Flymake starting automatically on a timer (flymake-no-changes-timeout is a number). By contrast, if flymake-no-changes-timeout is nil, the user starts the diagnostic collection process on-demand via 'M-x flymake-start'. Since the control of such collection is impossible with LSP, we should just hold on to whatever diagnostics we have (which are presumably up-to-date) until the next invocation of 'eglot-flymake-backend'. For now, this doesn't affect Flymake "list-only" diagnostics. Those are reported via the 'flymake-list-only-diagonstics' variable and are always communicated immediately to it. * eglot.el: (eglot-handle-notification textDocument/publishDiagnostics): Consult flymake-no-changes-timeout. Suggested-by: Jim Davis <jim.jd.davis@gmail.com>
Also per joaotavora/eglot#957. Only actually and eagerly report LSP diagnotics if the user has Flymake starting automatically on a timer (flymake-no-changes-timeout is a number). By contrast, if flymake-no-changes-timeout is nil, the user starts the diagnostic collection process on-demand via 'M-x flymake-start'. Since the control of such collection is impossible with LSP, we should just hold on to whatever diagnostics we have (which are presumably up-to-date) until the next invocation of 'eglot-flymake-backend'. For now, this doesn't affect Flymake "list-only" diagnostics. Those are reported via the 'flymake-list-only-diagonstics' variable and are always communicated immediately to it. * eglot.el: (eglot-handle-notification textDocument/publishDiagnostics): Consult flymake-no-changes-timeout. Suggested-by: Jim Davis <jim.jd.davis@gmail.com>
Also per #957. Only actually and eagerly report LSP diagnotics if the user has Flymake starting automatically on a timer (flymake-no-changes-timeout is a number). By contrast, if flymake-no-changes-timeout is nil, the user starts the diagnostic collection process on-demand via 'M-x flymake-start'. Since the control of such collection is impossible with LSP, we should just hold on to whatever diagnostics we have (which are presumably up-to-date) until the next invocation of 'eglot-flymake-backend'. For now, this doesn't affect Flymake "list-only" diagnostics. Those are reported via the 'flymake-list-only-diagonstics' variable and are always communicated immediately to it. * eglot.el: (eglot-handle-notification textDocument/publishDiagnostics): Consult flymake-no-changes-timeout. Suggested-by: Jim Davis <jim.jd.davis@gmail.com> #508: joaotavora/eglot#508 #957: joaotavora/eglot#957
Also per joaotavora/eglot#957. Only actually and eagerly report LSP diagnotics if the user has Flymake starting automatically on a timer (flymake-no-changes-timeout is a number). By contrast, if flymake-no-changes-timeout is nil, the user starts the diagnostic collection process on-demand via 'M-x flymake-start'. Since the control of such collection is impossible with LSP, we should just hold on to whatever diagnostics we have (which are presumably up-to-date) until the next invocation of 'eglot-flymake-backend'. For now, this doesn't affect Flymake "list-only" diagnostics. Those are reported via the 'flymake-list-only-diagonstics' variable and are always communicated immediately to it. * eglot.el: (eglot-handle-notification textDocument/publishDiagnostics): Consult flymake-no-changes-timeout. Suggested-by: Jim Davis <jim.jd.davis@gmail.com> GitHub-reference: fix joaotavora/eglot#508
Also per joaotavora/eglot#957. Only actually and eagerly report LSP diagnotics if the user has Flymake starting automatically on a timer (flymake-no-changes-timeout is a number). By contrast, if flymake-no-changes-timeout is nil, the user starts the diagnostic collection process on-demand via 'M-x flymake-start'. Since the control of such collection is impossible with LSP, we should just hold on to whatever diagnostics we have (which are presumably up-to-date) until the next invocation of 'eglot-flymake-backend'. For now, this doesn't affect Flymake "list-only" diagnostics. Those are reported via the 'flymake-list-only-diagonstics' variable and are always communicated immediately to it. * eglot.el: (eglot-handle-notification textDocument/publishDiagnostics): Consult flymake-no-changes-timeout. Suggested-by: Jim Davis <jim.jd.davis@gmail.com> GitHub-reference: fix joaotavora/eglot#508
I would like to disable the automatic buffer check that flymake does, so I set
flymake-no-change-timeout
to nil. This works fine in elisp buffers where I don't use eglot. However, once I turn on eglot in other buffers, the automatic check is back. I tried this with both Go and Python, here's the events transcript for Python:The text was updated successfully, but these errors were encountered: