emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/eglot2emacs 5c6eb3caa9 074/120: Don't ignore flymake-no-changes-


From: João Távora
Subject: feature/eglot2emacs 5c6eb3caa9 074/120: Don't ignore flymake-no-changes-timeout
Date: Thu, 20 Oct 2022 07:16:58 -0400 (EDT)

branch: feature/eglot2emacs
commit 5c6eb3caa903ad1479b3e901cee4b845bada1f1e
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Don't ignore flymake-no-changes-timeout
    
    Also per https://github.com/joaotavora/eglot/issues/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 https://github.com/joaotavora/eglot/issues/508
---
 lisp/progmodes/eglot.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index e8f060cd64..4e28de1875 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1996,7 +1996,11 @@ COMMAND is a symbol naming the command."
                                              collect it)))
                           `((face . ,faces))))))
            into diags
-           finally (cond (eglot--current-flymake-report-fn
+           finally (cond ((and
+                           ;; only add to current report if Flymake
+                           ;; starts on idle-timer (github#958)
+                           (not (null flymake-no-changes-timeout))
+                           eglot--current-flymake-report-fn)
                           (eglot--report-to-flymake diags))
                          (t
                           (setq eglot--diagnostics diags)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]