Skip to content

Commit

Permalink
Fix #159: Properly clear old diagnostics when making new ones
Browse files Browse the repository at this point in the history
* eglot.el (eglot-handle-notification
  textDocument/publishDiagnostics): Call flymake report function with
  :region.
  • Loading branch information
mkcms committed Dec 3, 2018
1 parent 4874c22 commit 38da3d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))))))
Expand Down

0 comments on commit 38da3d3

Please sign in to comment.