From: Josh Elsasser Date: Tue, 22 May 2018 00:15:12 +0000 (-0700) Subject: Demote unvisited diagnostics logging to debug level X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~537^2~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=45d4814a806ee611ae9ef2b2acc8927cf8903b90;p=emacs.git 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. --- 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'.