-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Show matching icons based on the filename in the repo tree view #24147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The diff is actually pretty small if you don't count the generated files |
fdb7ba5
to
6a286be
Compare
6a286be
to
8c8391e
Compare
Test failure is related |
Getting this PR merged will be fun as the two opposing views clash with each other in this PR: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before you do anything else, @lunny and I meant this a bit different.
Here's my temporary review.
Remove unused struct Fix test
Co-authored-by: delvh <dev.lh@web.de>
Signed-off-by: Yarden Shoham <git@yardenshoham.com>
This comment was marked as off-topic.
This comment was marked as off-topic.
By that logic, we can drop all SVGs... |
Well… Yes. But that is basically a PR of its own. As I've already written on Discord, I'm also fine with marking the functionality as deprecated/experimental and subject to change, and then refactoring the mechanism after this PR has been merged. (The funny thing is: With that, the default value of |
Experimental is fine I guess |
If we agree to use "icon pack" solution eventually, does it need to merge these 600+ SVG files now? We would see: this PR: +660 SVG files, next PR: -660 SVG files. 😄 |
Good idea. Could that become a part of theme? |
Sorry, I think @wxiaoguang 's idea is better and plugable.
I understand this approach will not be accepted |
@yardenshoham if you don't mind, I would try to implement "icon pack" approach, and re-use your code (co-author), does it look good to you? |
Yes, go ahead |
I wouldn't mind if we ship a default, unopinionated pack of icons that can be turned off via an option. Requiring extra configuration and especially defining a plugin interface for icons seems too much work and it would probably not see much adoption by the community I guess. |
That is to say, the approach in this PR was good enough? |
But if users could put their icons on |
Still, having the material icons by default would look good to most people that need no customization |
I can accept this PR. I do not see icons as part of the theme, but if we can make them overridable via custom folder, it's a nice bonus. I wouldn't expect any community themer to keep up with this task. Assuming we are going to frequently update the icons, it will be a herculean task to keep a custom icon set in sync with our base, which if it is the material one, seems to add new icons every week. |
I'm not gonna reopen because I think the majority will block |
It won't be so simple in many other cases where regex match is needed. That is one of the reasons why I don't see this as suitable for themeing. I don't see it as bloating, I see it as a nice optional enhancement to the UI. What is the total file size of the icons? |
I am trying to implement a "custom" approach based on yardenshoham's solution. Let's see if my proposal could work. If I my proposal has problems, let's continue here. |
The icon pack could contain similar logic as this PR and adding the icons is the "enable" flag. |
|
That hasn't even been implemented with the approach proposed in this PR, so I don't see a reason to support it at all. |
I'm sure that the material theme is good enough for 80%+ of users and if not, it can be disabled... |
I hadn't checked in detail how the matching worked (because the diff view is so slow), but it didn't seem like a simple "endsWith" check at first glance, but maybe it actually is. |
build/generate-svg.js
now generate from https://github.com/PKief/vscode-material-icon-theme the:assets/material-icons.json
)EntryIcon
returns hundreds of different icons, not the old (less than 10) resultsui.FILE_ICONS
: file-specific: [file-specific, basic]: Whether the file icons in the repo tree view should be specific to the file name (file-specific
) or the same icon for all files and another for the folders (basic
)Before
After (if you set
ui.FILE_ICONS = file-specific
inapp.ini
)