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.8k stars 892 forks source link

Icons for headerline breadcrumb are missing if lsp-treemacs is not installed #1858

Closed astenman closed 4 years ago

astenman commented 4 years ago

Describe the bug Icons for headerline breadcrumb are missing if lsp-treemacs is not installed

To Reproduce Use latest lsp-mode without lsp-treemacs breadcrumb

Expected behavior Something else than the empty boxes should be shown

Which Language Server did you use PHP Intelephense

OS Windows 10

ericdallo commented 4 years ago

Probably the check if lsp-treemacs is installed, is incorrect, I'll take a look later today, thanks for the report!

yyoncho commented 4 years ago

Probably the check if lsp-treemacs is installed,

we should fallback gracefully if lsp-treemacs is not installed.

ericdallo commented 4 years ago

Weird, that's already happening @yyoncho here, when returning nil, we just don't use the icon

yyoncho commented 4 years ago

@astenman are you sure that you don't have lsp-treemacs installed? Because the issue might be caused by your emacs compiled without png support.

astenman commented 4 years ago

Hello,

It seems that I have lsp-treemacs installed after all (although I do not use it). I have png-support compiled in. But also imagemagick, which might cause problems in this case.

Is it possible to force the use of all-the-icons instead of png?

Thank you for the good work!

Kind regards /Anders

On Tue, Jun 30, 2020 at 7:24 PM Ivan Yonchovski notifications@github.com wrote:

@astenman https://github.com/astenman are you sure that you don't have lsp-treemacs installed? Because the issue might be caused by your emacs compiled without png support.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/emacs-lsp/lsp-mode/issues/1858#issuecomment-651933944, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKNTBQTH45QQ4LWK7YZHUFLRZINTXANCNFSM4OMEBASQ .

yyoncho commented 4 years ago

Treemacs supports themes but AFAIK treemacs does not come with all-the-icons-theme OOTB. Doom emacs has such theme but we have to implement it in lsp-treemacs as well. There is this: https://github.com/emacs-lsp/lsp-treemacs/issues/18

Meanwhile, to diagnose the issue, can you check what are the paths when you do

(treemacs-get-icon-value (lsp-treemacs-symbol-kind->icon 6))

Also, are you using native compilation? I think that it was causing some issues with icon paths.

ericdallo commented 4 years ago

This does not fix the problem, but it's somehow related: https://github.com/emacs-lsp/lsp-mode/pull/1860

astenman commented 4 years ago

Recompiling emacs without ImageMagick solved the problem.

fosskers commented 3 years ago

Sorry to resurrect an old issue, but this does still seem to be a problem. If lsp-treemacs is not installed, icons don't appear.

For extra context, I'm on Doom, and adding (treemacs +lsp) to my init.el makes icons appear.

yyoncho commented 3 years ago

@fosskers we use lsp-treemacs if it is present. Then we fallback to all-the-icons. If you have installed all-the-icons make sure that you have installed the fonts as well. If neither is installed we don't display icons.

fosskers commented 3 years ago

Hm, I'm on master of lsp-mode, lsp-ui, and all-the-icons, but the icons still don't appear. I removed lsp-treemacs completely to be sure.

yyoncho commented 3 years ago

Have you installed all-the-icons fonts? @ericdallo - can you confirm that all-the-icons work on doom?

fosskers commented 3 years ago

I have them installed both via all-the-icons-install-fonts and via my package manager just in case.

I should say that all-the-icons works fine elsewhere for providing icons (like in the modeline), but for some reason not in the lsp-ui headerline.

ericdallo commented 3 years ago

@yyoncho I use all-the-icons on doom and it works pretty well with breadcrumb 🤔

fosskers commented 3 years ago

@yyoncho I use all-the-icons on doom and it works pretty well with breadcrumb thinking

Do you have (treemacs +lsp) on or off?

ericdallo commented 3 years ago

On: https://github.com/ericdallo/dotfiles/blob/master/.doom.d/init.el#L42

fosskers commented 3 years ago

Then that's what does it. I have you have it off, the icons won't appear, even though there is supposed to be a fallback (see above).

MintSoup commented 3 years ago

I'm having the same problem. Installing lsp-treemacs fixes it, but it doesn't work with just all-the-icons

memeplex commented 3 years ago

I've created a more specific issue for "icons showing but aren't all-the-icons": https://github.com/emacs-lsp/lsp-treemacs/issues/115

timjstewart1024 commented 2 years ago

M-x all-the-icons-install-fonts and restarting Emacs fixed it for me. Hope this helps.

fosskers commented 1 year ago

That commands downloads the fonts successfully but my headerline is unfortunately still iconless.

umgefahren commented 1 year ago

Did you have eventual success?

fosskers commented 1 year ago

Not here, no.

umgefahren commented 1 year ago

Funny enough, it doesn't even work for me if I have lsp-treemacs installed. I use emacs-mac with imagemagick (it doesn't work without it either) and I don't get them to show up at all. I tried unpinning lsp-treemacs as well as lsp-mode, still nothing. Running

(treemacs-get-icon-value (lsp-treemacs-symbol-kind->icon 6))

even shows something, so the problem is not with getting the icons.