EmmanuelBeziat / vscode-great-icons

🆚 A big pack of icons (200+) for your files
https://marketplace.visualstudio.com/items?itemName=emmanuelbeziat.vscode-great-icons
MIT License
163 stars 56 forks source link

Support for Dotfile and CommonJS Variations of Filenames #225

Closed codingwithchris closed 2 years ago

codingwithchris commented 2 years ago

First, I wanted to say thank you for supporting this project! It adds so much clarity and pizzaz to any project, but especially large projects and monorepos! And the icons themselves are fantastic!

I was wondering if it would be possible to add more robust file associations to icons. For example, in Svelte projects all of the configs for things like ESLint and Jest require a .cjs filename extension because the root type on these kinds of projects is module. In other larger projects, root configs are often prefixed with a .. Both of these conventions break file associations.

Examples

Jest file association

Screen Shot 2022-03-07 at 7 07 50 PM

Broken Jest file association w/ . or .cjs

Screen Shot 2022-03-07 at 7 08 02 PM Screen Shot 2022-03-07 at 7 08 17 PM

ESlint File association

Screen Shot 2022-03-07 at 7 25 15 PM

Broken ESLint File association w/ .cjs extension

Screen Shot 2022-03-07 at 7 25 34 PM

I've come across many others that exhibit similar behavior. In projects with 7+ root configs for various tools, it's a bummer to lose the visual context provided by these wonderful icons :/

If this is not a straightforward thing to address, is it possible to add my own configs in my vscode settings.json to associate icons with files?

Thanks again!

EmmanuelBeziat commented 2 years ago

Hello @codingwithchris !

The way vscode works is looking either at complete filenames or extention — much like a regex that I don't have control over. As of your example,, it's looking at a specific jest.config.js, so any variation in that, be it a dot in the front, a different extension (csj) or a typo, it won't match to it.

So, no choice but to add any specific variation that may be of use. As an example, for eslint, here's what is already registered:

".eslintrc": "_f_eslint",
".eslintrc.js": "_f_eslint",
".eslintrc.yml": "_f_eslint",
".eslintrc.yaml": "_f_eslint",
".eslintrc.json": "_f_eslint",

So I have to add a line for .eslintrc.cjs. No big deal, I just have to do it. But if Svelte project is adding specific extension to all kind of files, the issue is that I might miss a few ones that I don't think about at the moment, or that you might have not used yet. So if it happens, you'll have to update this ticket.

In the meantime, I'll add a bunch of them quickly :) Stay tuned!

EmmanuelBeziat commented 2 years ago

@codingwithchris okay, it's done! you can check the new version, and let me know if it's okay for you.

If you need more files, please let me know which ones and I'll add it up. :)

Thanks for helping making vscode a great set!

codingwithchris commented 2 years ago

This is great! Thank you so much!!