[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/eglot 1f7bcb1 06/11: Slightly polish the Flymake integr

From: João Távora
Subject: [elpa] externals/eglot 1f7bcb1 06/11: Slightly polish the Flymake integration
Date: Sun, 10 Jun 2018 09:57:28 -0400 (EDT)

branch: externals/eglot
commit 1f7bcb190e58c6a558d3d4b238c41611e419458c
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>

    Slightly polish the Flymake integration
    For backends, like RLS, that don't textDocument/publishDiagnostics
    right away, assume that the file is clean.  Since Flymake allows
    multiple reportings, it should be OK.
    * eglot.el (eglot--unreported-diagnostics): Move variable up here.
    (eglot--maybe-activate-editing-mode): Assume no diagnostics on
 eglot.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/eglot.el b/eglot.el
index 5ede791..81a63fd 100644
--- a/eglot.el
+++ b/eglot.el
@@ -900,6 +900,9 @@ If optional MARKERS, make markers."
 (add-hook 'eglot--managed-mode-hook 'flymake-mode)
 (add-hook 'eglot--managed-mode-hook 'eldoc-mode)
+(defvar-local eglot--unreported-diagnostics nil
+  "Unreported Flymake diagnostics for this buffer.")
 (defun eglot--maybe-activate-editing-mode (&optional server)
   "Maybe activate mode function `eglot--managed-mode'.
 If SERVER is supplied, do it only if BUFFER is managed by it.  In
@@ -908,6 +911,7 @@ that case, also signal textDocument/didOpen."
   (let* ((cur (and buffer-file-name (eglot--current-server)))
          (server (or (and (null server) cur) (and server (eq server cur) 
     (when server
+      (setq eglot--unreported-diagnostics `(:just-opened . nil))
       (eglot--managed-mode-onoff server 1)
@@ -1057,9 +1061,6 @@ function with the server still running."
   (_server (_method (eql :telemetry/event)) &rest _any)
   "Handle notification telemetry/event") ;; noop, use events buffer
-(defvar-local eglot--unreported-diagnostics nil
-  "Unreported diagnostics for this buffer.")
 (cl-defmethod eglot-handle-notification
   (server (_method (eql :textDocument/publishDiagnostics)) &key uri 
   "Handle notification publishDiagnostics"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]