Function: eglot--flymake-push

eglot--flymake-push is a byte-compiled function defined in eglot.el.gz.

Signature

(eglot--flymake-push &optional VOID)

Documentation

Push previously collected diagnostics to eglot--flymake-push-report-fn.

If VOID, knowingly push a dummy do-nothing update.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/eglot.el.gz
(cl-defun eglot--flymake-push
    (&optional void &aux (diags (nth 0 eglot--diagnostics))
               (version (nth 1 eglot--diagnostics)))
  "Push previously collected diagnostics to `eglot--flymake-push-report-fn'.
If VOID, knowingly push a dummy do-nothing update."
  (unless eglot--flymake-push-report-fn
    ;; Occasionally called from contexts where report-fn not setup, such
    ;; as a `didOpen''ed but yet undisplayed buffer.
    (cl-return-from eglot--flymake-push))
  (eglot--widening
   (if (or void (and version (< version eglot--docver)))
       ;; Here, we don't have anything interesting to give to Flymake: we
       ;; just want to keep whatever diagnostics it has annotated in the
       ;; buffer. However, as a nice-to-have, we still want to signal
       ;; we're alive and clear a possible "Wait" state.  We hackingly
       ;; achieve this by reporting an empty list and making sure it
       ;; pertains to a 0-length region.
       (funcall eglot--flymake-push-report-fn nil
                :region (cons (point-min) (point-min)))
     (funcall eglot--flymake-push-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))))))