Skip to content

Commit

Permalink
Fix #851: Prevent empty Diagnostic tags vector hiding main fontification
Browse files Browse the repository at this point in the history
* 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 <joaotavora@gmail.com>

#851: joaotavora/eglot#851
  • Loading branch information
leungbk authored and joaotavora committed Mar 2, 2022
1 parent 2100ab0 commit 3119343
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lisp/progmodes/eglot.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 3119343

Please sign in to comment.