]> git.eshelyaron.com Git - emacs.git/commitdiff
More rls-specifics: update flymake diags when indexing done
authorJoão Távora <joaotavora@gmail.com>
Thu, 10 May 2018 11:51:21 +0000 (12:51 +0100)
committerJoão Távora <joaotavora@gmail.com>
Thu, 10 May 2018 12:15:32 +0000 (13:15 +0100)
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

index f865c22589ebf07aa63ef9a13e8ba9236c905409..1ba5324de93644d3cd6738d66a5eebde7b46cba5 100644 (file)
@@ -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