emacs-lsp / lsp-treemacs

lsp-mode :heart: treemacs
GNU General Public License v3.0
398 stars 47 forks source link

Possibility to remove the icons #66

Open Nathan-Furnal opened 3 years ago

Nathan-Furnal commented 3 years ago

Hi,

I'm using lsp-treemacs and it added icons which I don't use at all in regular treemacs. How can I remove the icons and not use them?

Thanks!

nbfalcon commented 3 years ago

How did you disable the icons for regular treemacs? You can customize the icon theme of lsp-treemacs using the lsp-treemacs-theme variable, so perhaps you could set some icon theme that has no icons for it.

Nathan-Furnal commented 3 years ago

In treemacs one can set a variable like this :

(setq treemacs-no-png-images t)

I'm not sure how changing the theme would affect the behavior of my current theme, it'd be just easier not to have them tbh

nbfalcon commented 3 years ago

If you are happy with sacrificing the arrows, I could offer the following (temporary!) kludge, until we actually implement this properly (so don't close this issue yet):

(eval-after-load 'lsp-treemacs (defun lsp-treemacs--generic-icon (&rest _) ""))

Here is how it would look on latest treemacs master + lsp-mode master: 20201112-180325

Nathan-Furnal commented 3 years ago

That wouldn't be an issue for me ! This is how my treemacs looks for reference

Screenshot_20201112_180851 And like this when I "unroll" it :

Screenshot_20201112_181122

So that's just good old treemacs without any fluff aside from the symbols that indicate a different level in the tree structure.

Thanks for getting back to me!

swinkels commented 3 years ago

In treemacs one can set a variable like this :

(setq treemacs-no-png-images t)

I'm not sure how changing the theme would affect the behavior of my current theme, it'd be just easier not to have them tbh

I see that lsp-treemacs.el always calls treemacs-get-icon-value with second parameter nil. That second parameter indicates whether the TUI version of the icon should be used (when non-nil) or the GUI version (when nil). I may be wrong here as I'm not familiar with the treemacs code, or Emacs Lisp for that matter, but lsp-treemacs could take the value of treemacs-no-png-images into account. That it doesn't appear to do so may be by design, I don't know.

To disable the use of icons I locally replaced the nil in the call to treemacs-get-icon-value by treemacs-no-ping-images, which I've set to t. It works for the use case I have.

eeshugerman commented 3 years ago

@nbfalcon if implemented, would this proposed feature/switch also solve https://github.com/hlissner/emacs-doom-themes/issues/500? if not, shall i open a separate issue?

nbfalcon commented 3 years ago

No, that is unrelated (this is lsp-treemacs, not normal treemacs)

eeshugerman commented 3 years ago

The issue only appears once lsp-mode starts up, so I'm pretty sure it's an lsp-treemacs issue.

nbfalcon commented 3 years ago

Upon further inspection, this is probably related. Can you check with the triage/ugly-icons branch on my fork? Note that this is not a proper fix, and is only to find out if this is due to lsp-treemacs, as it will probably break lots of icons in the latter.

eeshugerman commented 3 years ago

it works! no icon issues present when i use that branch (none that i can see anyway, with the "doom-colors" theme; i don't mean to suggest it's not breaking other stuff as you mentioned).

nbfalcon commented 3 years ago

Great! So the issue here is that we are modifying the "Default" treemacs theme, and replacing some icons which were probably provided by all-the-icons with png icons. The former uses a font and so they are vector graphics and scale well, while the latter ones are raster graphics and don't. The icons that are needlessly overridden in lsp-treemacs-icons would need to be examined. Note that this is unrelated to this issue, though.

eeshugerman commented 3 years ago

got it :+1: i opened a new issue, see above