emacs-lsp / lsp-mode

Emacs client/library for the Language Server Protocol
https://emacs-lsp.github.io/lsp-mode
GNU General Public License v3.0
4.75k stars 869 forks source link

lsp-diagnostics-attributes hard to customize in theme #2037

Open muirdm opened 4 years ago

muirdm commented 4 years ago

Instead of factoring the face attributes out to a variable, can we instead just enumerate all the faces and use face inheritance to share styling? That would make it more straightforward to customize the lsp-lsp-flycheck-*-*-face faces in themes.

Themes can set variables using custom-theme-set-variables, but I think it is simpler and more accessible if the faces work like all other faces work.

yyoncho commented 4 years ago

I think that even now you can define a face and it will be used. I did it that one considering that if the number of tags grows the number of faces will have factorial grow.

muirdm commented 4 years ago

You can override the faces but they don't take effect when you restart Emacs (probably due to the dynamic face creation, not sure).

yyoncho commented 4 years ago

I think that the code was supposed to check if the face exists and use it. Will fixing this in case it is not working be sufficient for you?

muirdm commented 4 years ago

Will fixing this in case it is not working be sufficient for you?

Yes, if I can enumerate the faces myself in my theme (and have it take effect across restart) then that is great.

sebschub commented 1 year ago

It would be great if a customized face would be persistent between restarts of Emacs. In my case, lsp-flycheck-error-unnecessary-face for Python is both gray and underlined. I found no way to get rid of the underlining...

onekk commented 1 year ago

How did I can customize a face, I'm trying to customize:

lsp-flycheck-warning-unnecessary-face

And using the default cutomization emacs, mechaniusm, ie adding

'(lsp-flycheck-warning-unnecessary-face ((t (:foreground "black" :underline (:color "DarkOrange" :style wave)))) t)

in:

(custom-set-faces

did not work.

With a light theme lines are almost unreadable ad "dim gray" is very weak

Regards.

Carlo D.