From: Brian Leung Date: Tue, 1 Mar 2022 15:59:05 +0000 (-0800) Subject: Prevent empty diagnostic tags vector hiding main fontification X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~73 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4f1f06375a219178ba681a6101af1fece73024b0;p=emacs.git Prevent empty diagnostic tags vector hiding main fontification * eglot.el (eglot-handle-notification): Require that the resulting list of faces is non-empty and that each face corresponds only to a known tag. For unknown tags, we don't pass any additional face information to Flymake, and instead expect it to make the appropriate overlay with the "severity" property of the Diagnostic. Co-authored-by: João Távora GitHub-reference: fix https://github.com/joaotavora/eglot/issues/851 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 5a0a8caba48..3f84b3b7a26 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1866,11 +1866,11 @@ COMMAND is a symbol naming the command." (current-buffer) beg end (eglot--diag-type severity) message `((eglot-lsp-diag . ,diag-spec)) - (and tags - `((face - . ,(mapcar (lambda (tag) - (alist-get tag eglot--tag-faces)) - tags))))))) + (when-let ((faces + (cl-loop for tag across tags + when (alist-get tag eglot--tag-faces) + collect it))) + `((face . ,faces)))))) into diags finally (cond (eglot--current-flymake-report-fn (eglot--report-to-flymake diags))