From 45d4814a806ee611ae9ef2b2acc8927cf8903b90 Mon Sep 17 00:00:00 2001 From: Josh Elsasser Date: Mon, 21 May 2018 17:15:12 -0700 Subject: [PATCH] Demote unvisited diagnostics logging to debug level The PublishDiagnostic spec (LSP Specification, 3.0) does not strictly forbid the server from publishing diagnostics before a file has been visited. * eglot.el (eglot--server-textDocument/publishDiagnostics): Log the "received diagnostics for unvisited file" warning as debug to avoid spamming users of compliant language servers. --- lisp/progmodes/eglot.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 92f16c0d04f..467e524b073 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1038,7 +1038,7 @@ function with the server still running." "Unreported diagnostics for this buffer.") (cl-defmethod eglot-handle-notification - (_server (_method (eql :textDocument/publishDiagnostics)) &key uri diagnostics) + (server (_method (eql :textDocument/publishDiagnostics)) &key uri diagnostics) "Handle notification publishDiagnostics" (if-let ((buffer (find-buffer-visiting (eglot--uri-to-path uri)))) (with-current-buffer buffer @@ -1060,7 +1060,7 @@ function with the server still running." (setq eglot--unreported-diagnostics nil)) (t (setq eglot--unreported-diagnostics diags))))) - (eglot--warn "Diagnostics received for unvisited %s" uri))) + (eglot--debug server "Diagnostics received for unvisited %s" uri))) (cl-defun eglot--register-unregister (server jsonrpc-id things how) "Helper for `registerCapability'. -- 2.39.2