-
Notifications
You must be signed in to change notification settings - Fork 29.3k
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
Add file icons support in the explorer #211
Comments
+1 |
Any progress on this? |
+1 Maybe its possible to add a language and\or file-ext attributes here for themes to render icons? |
+1 I mostly have issues trying to distinguish the difference between a file and a folder quickly. There isn't even a text color difference. |
What is interesting is that there is logic in place to add icon classes: private iconClass(element: FileStat): string {
if (element.isDirectory) {
return 'folder-icon';
}
return 'text-file-icon';
} As seen above, vscode currently adds a folder-icon css class to all folders but a style is not defined for it. So if you want to see folder icon in explorer, all you have to do is add the below styles to /resources/app/out/vs/workbench/workbench.main.css .monaco-tree-row .content .sub-content .explorer-item.folder-icon {
padding-left: 22px;
background: url(./parts/files/browser/media/Folder.png) 1px 4px no-repeat;
}
.monaco-tree-row.expanded .content .sub-content .explorer-item.folder-icon {
padding-left: 22px;
background: url(./parts/files/browser/media/Folder_opened.png) 1px 4px no-repeat;
}
.explorer-item.text-file-icon {
padding-left: 22px;
background: url(./parts/files/browser/media/Textfile.png) 1px 4px no-repeat;
} and copy the below icon images to /resources/app/out/vs/workbench/parts/files/browser/media Here is a preview of it in action: In it's simplest form, implementing the file icon feature would require modifying the above iconClass method to return 'text-file-' + getFileExtension(element.name) and adding corresponding icon svg/font to each css classes (i.e., text-file-js, text-file-md, etc.) |
Nice find @Snpai. It would be very easy if they could add another class like |
This feature is sorely needed, and is trivial to implement. I was able to use @pflannery's fork and https://github.com/mrmartineau/SetiUI-Icons-Sublime to add in default icons right into the my own build. One thing though: some files should be themed based off of more than extension. package.json, gulpfile.js, etc should be themed based off of name. I suppose adding built-in support for specific filename classes would be better (faster/less cluttering to the DOM) than adding a class for the entirety of every file's name. While we wait, does anyone have a comprehensive, "good" looking grayscale icon pack? The icon pack I used doesn't mesh very well with the dark theme and is a little distracting. |
@nelsonlaquet you made a good point about the gulp, grunt and package.json files and thanks for linking the icons too. |
+1 |
Is the file tree exposed to extensions api? if you can expose it, i think that would allow the community to create an extension for this and for any further opinionated customizations all the while VSCode itself can remain neutral on the issue |
If that would be added, I'd like to port my icon extension (Brackets Icons) for Brackets to VS Code. In Brackets, an icon provider can be added, which is a function that returns an icon as a DOM element for a specified file name (docs). Since VS Code doesn't expose the DOM, there should be a layer between, but similar ideas can be used. |
No API atm to change the explorer. |
@bpasero is there plans for such a thing in the near future? if yes, any rough ETA? |
@egamma @chrisdias please chime in. |
+1 |
@bpasero Could you list the needed acceptance criteria to get a pull request merged? Maybe I could help then. |
@donaldpipowitch I would think this feature should:
Still, our PM/UX might decide to veto. @chrisdias @stevencl please chime in. |
@Tyriar do you guys (core team) have a proper API planned then? I understand this is a hack, but this is as close as we can get without support from the core team. |
Thanks for the explanation @Tyriar. I agree that it's a hack but at least it will keep a few of us happy until the official support. If there is an existing plan of how you guys want to implement it, I will be very glad to contribute. |
A few of us have been talking about it, we need to have a team-wide discussion ideally in a GitHub issue. |
Thanks, @robertohuertasm for making an extension that gives file icons to the vscode is really nice, even if it's hacky. |
I know I should know better than to armchair project-manage, but this feels like low hanging fruit with a big ROI. I like VSCode for it's deep support of various JS features + intellisense --icons aren't a make or break feature for me-- but there a lot of people for whom this is a make-or-break feature. I guarantee there are visually oriented folks who will try VSCode then quickly bounce back to Sublime/Brackets/whatever when they see that this basic feature is missing. My intuition-based belief: not having this feature will have a significant negative impact on the adoption of VS Code. It's silly but I believe it's true. I care because I really like VS Code & I am recommending it to people, I want them to like it. 😸 |
+1 |
A first example is also included: gitStatusTreeDecorator Resolves microsoft#5866 Related microsoft#211
+1 |
Any progress on this? I want to replace sublime with vscode but it's hard to find file types without icons. I can't believe something so essential is missing... |
@darkguy2008 For now you can use https://marketplace.visualstudio.com/items?itemName=robertohuertasm.vscode-icons until the official support. It works well! |
@gsaadeh yeah I just found it, thanks! it takes some trial and error to get it installed and working at first though. It'd be a good idea to merge the extension in VSCode's core though 👍 |
If anyone has issues on Windows7 with the icons not appearing: Just figured it out. For some reason even when pushing "Enable" it doesn't fire the event. I had to do:
Then they appeared. Just a note for anyone else who runs into it! |
+1 |
Added support for file icon themes. See #10804 for documentation. |
Can you please add file icons support in the tree view?
I know that access from extension to the DOM is restricted. But it will be good to add some language-id attribute to the tree-view element. For example in the render function. So it will be easy to modify view of files with different types with CSS, without modifying DOM.
And also It will be nice to add possibility to add/modify directly CSS from extension.
The text was updated successfully, but these errors were encountered: