From: Michal Krzywkowski Date: Mon, 3 Dec 2018 11:49:34 +0000 (+0100) Subject: Properly clear old diagnostics when making new ones X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~377 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4a9914c0e66ebb2ba41e894a58d2598e8dc44687;p=emacs.git Properly clear old diagnostics when making new ones * eglot.el (eglot-handle-notification textDocument/publishDiagnostics): Call flymake report function with :region. GitHub-reference: fix https://github.com/joaotavora/eglot/issues/159 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 2e99fc0cdd3..86db5ea322f 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1313,7 +1313,13 @@ COMMAND is a symbol naming the command." message `((eglot-lsp-diag . ,diag-spec))))) into diags finally (cond ((and flymake-mode eglot--current-flymake-report-fn) - (funcall eglot--current-flymake-report-fn diags) + (funcall eglot--current-flymake-report-fn diags + ;; If the buffer hasn't changed since last + ;; call to the report function, flymake won't + ;; delete old diagnostics. Using :region + ;; keyword forces flymake to delete + ;; them (github#159). + :region (cons (point-min) (point-max))) (setq eglot--unreported-diagnostics nil)) (t (setq eglot--unreported-diagnostics (cons t diags))))))