Closed vjohansen closed 1 year ago
can you try deleting your elpa dir + restarting emacs + reinstalling the packages?
Just tried it (deleted entire .emacs.d folder that included elpa folder). Same results : a lot of warnings.
I got mislead by reading the comments in #2255. I did not actually have the fix from leungbk since it is not released yet. The lsp-mode version I get from melpa is 8.0.0. Some of the commentors in #2255 does not appear to know this.
If I change lsp-diagnostics.el to include the fix the "Invalid face reference: lsp-flycheck-info-unnecessary" issue is gone and I am left with a LOT of "Invalid face reference: quote"
For example if I open a tsx file and change a variable declaration name I get 'xx is declared but its value is never read'. When I move left or right while point is in the identifier 10 occurences of "Invalid face reference: quote" happen each time.
Maybe this bug report should be closed and I should make a new for "Invalid face reference: quote". But this issue seems difficult to debug.
These are my findings.
This is what lsp-mode
does:
For each error of some level and tagged with some tags that LSP server yields:
lsp-flycheck-info-unnecessary
, lsp-flycheck-info-unnecessary-category
and lsp-flycheck-info-unnecessary-face
respectively.face
of generated category to generated face.
lsp-flycheck-info-unnecessary-category
.face
<- lsp-flycheck-info-unnecessary-face
.symbol-overlay-1
.category
property of symbol overlay to generated category.
symbol-overlay-1
.category
<- lsp-flycheck-info-unnecessary-category
.sideline-overlay-1
.face
property of error message to generated flycheck level. BUG?????
face
<- lsp-flycheck-info-unnecessary
.Emacs can't find the face named as generated flycheck level as many times as characters in error message? So many error messages like
Invalid face reference: lsp-flycheck-info-unnecessary [38 times]
are emitted.
If authors pretended to use the same face for symbol overlay and sideline overlay, both face
properties should be set to generated face.
To avoid changing the original source code, the referenced face can be defined in init file. E.g:
(defface lsp-flycheck-info-unnecessary
'((t))
"Face which apply to side line for symbols not used.
Possibly erroneously redundant of lsp-flycheck-info-unnecessary-face."
:group 'lsp-ui-sideline)
Then it can be themed or customized. Remember this is the face for sideline overlay. This has stopped all error messages for me.
I prefer different faces for symbol overlay and sideline overlay.
But that of sideline overlay should be named lsp-ui-sideline-{level}-{tags}-face
.
If a generated flycheck level like lsp-flycheck-info-unnecessary
is made a face name, it confuses users when looking for a face name related to sidelines.
Thanks @pixel-ant , your analysis and commentary were very helpful.
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
I get a lot of Invalid face reference in the messages buffer. See also latest comment here #2255
Sometimes 50 message per second in typescript buffer with lsp-mode enabled.
lsp-mode version 20221207.1707
Steps to reproduce
change a ts-file so it does not compile
Expected behavior
No error messages in messages buffer
Which Language Server did you use?
ts-ls it seems
OS
Windows
Error callstack
No response
Anything else?
No response