vscode-icons icon indicating copy to clipboard operation
vscode-icons copied to clipboard

script folder icon override to default folder icon does not work

Open JanCervak opened this issue 2 years ago • 1 comments

Housekeeping

  • [X] I'm sure this issue is not a duplicate

Information:

Folder named "script" or "scripts" defaults to a specific icon (ListOfFolders).

When trying to override to default folder icon in a workspace settings:

"vsicons.associations.folders": [
	{ "icon": "folder", "extensions": ["scripts"] }
]

the scripts folder icon completely disappears: image

When overriding with for example "audio" icon:

"vsicons.associations.folders": [
	{ "icon": "audio", "extensions": ["scripts"] }
]

it works as expected and the audio folder icon is displayed for the scripts folder: image

Versions: vsicons v11.4.0 vs code 1.74.3

JanCervak avatar Feb 16 '23 09:02 JanCervak

No solution planned? A year later, issue still the same (vsicons 12.7.0, vs code 1.86.2)

JanCervak avatar Feb 20 '24 11:02 JanCervak

Nothing to be fixed. Pls read again https://github.com/vscode-icons/vscode-icons/wiki/Custom Hint: You are trying to customize scripts by altering the default folder icon.

JimiC avatar Feb 27 '24 07:02 JimiC

@JimiC, the provided link describes how to add a user icon to be used by vscode-icons. I want just to "revert back" to ordinary folder icon for a folder named scripts. In my sandpit workspace it has no special meaning, so the visual distinction is just annoying. For it is possible to change to other icon from the standard set ListOfFolders, this seems to be a bug.

JanCervak avatar Feb 27 '24 11:02 JanCervak

Let me get this clear. You want the default folder icon to be shown for a folder named scripts, right?

JimiC avatar Feb 27 '24 11:02 JimiC

Let me get this clear. You want the default folder icon to be shown for a folder named scripts, right?

Naturally.

JanCervak avatar Feb 27 '24 13:02 JanCervak

What you are trying to do is to customize your scripts folder, thus you fall into the customization feature. The way you are trying to use the feature is not the way it's designed to work.

Let me explain. VSCode has 3 types of folder icons that we can declare.

  1. Default folder icon (declared as default_folder_{state})
  2. Root folder icon (declared as default_root_folder_{state})
  3. Any other folder icon (declared as folder_type_{name}_{state})

Your case is case 3, thus you need to follow the customization instructions. The only upside in your case is that we already provide the icon you want to use, so you don't have to create any.

What you can do is to copy the 2 default_folder_{state} icons and name them folder_type_folder_{state}, since you use "icon":"folder" in your declaration and place them in a vsicons-custom-icons folder as instructed.

This ain't easy you say? It is what it is, unfortunately.

JimiC avatar Feb 27 '24 14:02 JimiC

@JimiC, absolutely, I want to customize the visual appearance, unfortunately you are not suggesting Customization, but Custom Icons wiki page. Anyway, your described solution might be a working workaround.

Fortunately, the 'Custom Icons' section was helpful, for there is stated the icon naming pattern. Together with the content of the extension-bundled icons folder it is clear, that the default file & folder icons are something special - these do not follow the pattern.

For my intent, I've probably started with examples Fine Tuning together with ListOfFolders. As suggested in the issue description, icon names in the list work fine except for the special 'folder' and 'root_folder'.

Finally, by a guess I've found out simple working solution - omitting the icon name:

"vsicons.associations.folders": [
	{ "icon": "", "extensions": ["scripts"] }
]

image

PS: I hope this won't be subject to any future change:)

JanCervak avatar Feb 27 '24 17:02 JanCervak

  1. Custom Icons is a sub subject of Fine tuning which is a sub subject of Customization. Customization page doesn't provide much info, does it? I was merely pointing you to a direction which in the end helped you, right?
  2. The way you solved it, is simply because vscode defaults to the default folder icon when an icon file is not specified via icon definition. You should thank vscode devs for that, not us.

Anyways, glad you figured it out.

JimiC avatar Feb 27 '24 17:02 JimiC