From 845063c090678d5888f69ec58baebe215b26f885 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Thu, 10 May 2018 12:51:21 +0100 Subject: [PATCH] More rls-specifics: update flymake diags when indexing done RLS could/should report diagnostics for every opened file, even if there aren't any problems. Because it doesn't, loop for every buffer managed by the process and call eglot--current-flymake-report-fn * eglot.el (eglot--server-window/progress): Call eglot--current-flymake-report-fn --- lisp/progmodes/eglot.el | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index f865c22589e..1ba5324de93 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -825,6 +825,9 @@ DEFERRED is passed to `eglot--request', which see." (or (and (null proc) cur) (and proc (eq proc cur)))))) +(defvar-local eglot--current-flymake-report-fn nil + "Current flymake report function for this buffer") + (defun eglot--maybe-activate-editing-mode (&optional proc) "Maybe activate mode function `eglot--managed-mode'. If PROC is supplied, do it only if BUFFER is managed by it. In @@ -969,9 +972,6 @@ called interactively." "Handle notification telemetry/event" (eglot--log "Server telemetry: %s" any)) -(defvar-local eglot--current-flymake-report-fn nil - "Current flymake report function for this buffer") - (defvar-local eglot--unreported-diagnostics nil "Unreported diagnostics for this buffer.") @@ -1479,7 +1479,13 @@ Proceed? " (cl-defun eglot--server-window/progress (process &key id done title message &allow-other-keys) "Handle notification window/progress" - (setf (eglot--spinner process) (list id title done message))) + (setf (eglot--spinner process) (list id title done message)) + (when (and (equal "Indexing" title) done) + (dolist (buffer (buffer-list)) + (with-current-buffer buffer + (when (eglot--buffer-managed-p process) + (funcall (or eglot--current-flymake-report-fn #'ignore) + eglot--unreported-diagnostics)))))) (provide 'eglot) ;;; eglot.el ends here -- 2.39.2