Open memeplex opened 2 years ago
AFAIC @ericdallo is using similar setup. Can you help with the config settings to achieve what OP wants?
AFAIK is just use the treemacs all-the-icons
theme that was included some time ago in treemacs here
@ericdallo as described above treemacs is configured to use all-the-icons (see the screenshots) but the breadcrumb (and emacs-lsp in general) still uses image icons. There are many similar reports at the end of https://github.com/emacs-lsp/lsp-mode/issues/1858.
Moreover, switching everything to image icons for consistency is neither a good option as per https://github.com/emacs-lsp/lsp-mode/issues/3143.
I see, I stopped using headerline-breadcrumb, but I'll try to take a look on lsp-mode code to understand why it's using the images instead of all-the-icons
Great, thanks, I was looking at your config here https://github.com/ericdallo/dotfiles/blob/master/.doom.d/init.el#L42. I'm not a doom emacs user but I believe they turn off the breadcrumb by default.
It seems like support for all-the-icons is not provided through a transparent, unified icon interface across emacs-lsp and it's only used in an ad hoc way for the headerline arrow.
The problem is not restricted to the headerline indeed, if you take a look at the session explorer it isn't using all-the-icons.
unified icon interface across emacs-lsp and it's only used in an ad hoc way for the headerline arrow.
Unfortunately, there is no such interface so that it can be used across all packages. Also, the icons on each place were not added at the same time.
Considering the conversations here and in https://github.com/emacs-lsp/lsp-mode/issues/3143 maybe it's better to open a "meta" issue in order to coordinate icon related tasks, because the situation is quite messy. Some things are totally missing or only partially provided. Potential TODO list:
- Provide consistent lsp, treemacs and company themes across the board
The question is how to achieve that. In an ideal world, we will have a root package "icons" which provides an api to add these icons. At this point, each component has a separate set of icons and a separate API to add and configure them.
the idea behind lsp-icons.el
was to provide something like that as a start
lsp-icons.el cannot be used by company-mode nor treemacs...
But company, company-box and treemacs provide interfaces to set the icons, so it could be done.
emacs-lsp seems a natural place to coordinate those icon sets, but it would be nicer to have consistent icon themes that don't require lsp, using treemacs with company but without lsp is still an important use case.
You know like base16 has become a meta theme for many many tools.
Yeah, I am not saying that it is not possible. I am just saying that we have to provide something like a recipe - do this and that, and you will get a consistent look.
You can have a package that provides one function that receives an icon theme name and takes care of setting every other project in a consistent manner, so it would be very simple for the user to achieve consistency. It's technically easy but still rather laborious. In any case, I wouldn't put that package under emacs-lsp/lsp-mode but it's ok if it's inside emacs-lsp as far as it can be also used without lsp, so the community at large will benefit and also users of lsp-mode that not necessarily use lsp for all their programming needs. In a similar vein, I dislike the idea that only emacs "distros" take care of this, because then you will be "locked-in" due to some comparatively minor issue like icon consistency.
Coming back to the specific issue, lsp-treemacs-symbol-icon
uses lsp-treemacs-theme
which is not in sync with the theme treemacs is effectively using. By default it's, well, "Default"
. So that's probably a source of confusion for people saying treemacs is set to use all-the-icons but lsp is ignoring that.
Anyway, setting lsp-treemacs-theme
to "all-the-icons" kind of improves things a bit:
But there are still missing icons, probably because of naming mismatches between lsp and treemacs. That's likely the reason why lsp-treemacs-themes.el is redefining themes.
Leaving company and svg aside, here is a solution:
lsp-treemacs-theme
set to nil and try to match the current treemacs theme with an equally named theme in lsp-treemacs, only if that's not possible fallback to the "Default"
theme.
- Copy&paste the code from https://github.com/Alexander-Miller/treemacs/blob/master/src/extra/treemacs-all-the-icons.el to lsp-treemacs-themes.el and do the appropriate renamings or whatever adjustments you see fit.
Mmm, I don't think this will be very useful, I thought there were icons for classes, methods, functions, etc. in treemacs-all-the-icons.el and it was mostly a matter of naming, but the fact is that there are little to no icons for that stuff, when you expand a file in the tree you only get a couple of icons with very little semantic awareness, for example:
Perhaps company-box all-the-icons theme is a better source of inspiration. Indeed the themes in https://github.com/emacs-lsp/lsp-treemacs/blob/master/lsp-treemacs-themes.el seem to be taken from https://github.com/sebastiencs/company-box/blob/master/company-box-icons.el only that all-the-icons theme is missing. Maybe it wasn't there when you guys created lsp-treemacs-themes.el, was it?
So seemingly the situation is not that bad. If lsp icons are mostly copied from company-box and have very little overlapping with treemacs icons, then everything will be pretty consistent out of the box. Of course the style of the icons still matter, specially fonts vs images, but at least there is no overlapping between the icons themselves, between "file explorer matters" and "programming matters" to say so.
- Start with lsp-treemacs-theme set to nil and try to match the current treemacs theme with an equally named theme in lsp-treemacs, only if that's not possible fallback to the "Default" theme.
Given the above, it seems now that company's theme is even more important for lsp that treemacs'. Maybe the best alternative is to add some guidelines in the documentation explaining how to set company-box, treemacs and lsp in a consistent fashion, instead of coding some magical patchwork.
I'm not sure if I should report this here but it seems that lsp uses the icon theme of treemacs. If there is a better place, please let me know.
Compare the icons (all-the-icons) in treemacs:
with the ones in the breadcrumb:
Not only utterly inconsistent but also the images render blurry in a HiDPI screen (MacBook).
There are related issues reported:
which I believe is not true anymore. Then there are a lot of comments saying that the icons are indeed showing but are not all-the-icons, which is my concern here. So I believe a specific ticket has to track that issue.