Vscode-material-icon-theme: Support workspace settings

Created on 26 Feb 2018  路  19Comments  路  Source: PKief/vscode-material-icon-theme

Adding hidesExplorerArrows and folders.associations has no affect if they're added to workspace settings. No prompt is shown to restart and restarting does not apply the changes

When the same settings are added to user settings, a prompt is displayed to restart VS Code and are correctly displayed when VS Code is restarted.

Although it appears the user settings are remembered, as removing folders.associations keeps the set folder icons - so didn't notice this didn't work when I first moved the settings on device 1. Saving as an empty object first removes the associations on restart

Settings used
"material-icon-theme.hidesExplorerArrows": true,
"material-icon-theme.folders.associations": {
    "report": "docs",
    "implementation": "docs",
    "pyg": "temp",
    "bin": "config",
    "hibari": "components",
    "json_api": "components",
    "kitsu": "components"
}

Most helpful comment

I recently tried to work on this feature. The conclusion from my side was that it's still not really feasible, because all workspaces are using the same global icon configuration which is stored in the central extension folder. So it would be possible to load the workspace settings and to adjust the icons without reloading (for some settings). But if you've multiple workspaces opened at the same time, and open another workspace with different icon settings, it will change all icons of all opened workspaces, too. And this behavior is in my opinion not really nice and may look like a bug. It's still not feasible to implement this feature the way I wish it would work.

All 19 comments

@wopian Yes currently the extension can only be configured by the user settings. Changes in the workspace settings have no effect. I don't know if it makes sense to use the workspace settings, too. If you have different settings for the extension in each workspace you'll be prompted to restart the editor very often. This could be annoying to some users.

Yeah more restart prompts wouldn't be ideal. I presume the restart limitation is on VS Code's side?

Not much of an issue either way though - just a small QoL to get more unique folders iconified in projects :+1:

Yes, thank you for the question. As far as I know VS Code has no restart limitations at the moment. I will try to evaluate the workspace settings in the near future and let's see how the extension could be improved here 馃槈

Hi, any news? I'm working on React and also on Angular projects. It would be awesome to have a proper icons for each project.

@deftomat I understand your issue. It would be great to apply different settings to the icons for some projects. I tried to implement this feature, but every time I opened another project I was prompted to restart the extension because of the different settings. The restart is also required if you open a new project folder without any workspace settings after you were working on e.g. a React project. Then the user settings will be applied again and the editor has to be reloaded, too. That was very annoying and felt like a bad user experience.

In my opinion it will be much better if we wait until the API of VS Code will be improved so that the extension can change the icons without reloading the whole window every time. Then we would have a great user experience because you don't have to interrupt your workflow by changing the icons every time.

@PKief Great, thanks for your answer...

Yes, I agree that we should wait for the right API to make it flawless.

@PKief since with vscode 1.31 you don't have to restart vscode for enabling/disabling extensions, could you take another look to this issue?

@PKief Yes please. I would be great if the icons change using workspace settings too.

It looks like something is happening with the API here, but there is no final decision yet on how it will be implemented. I'll keep you up to date.

I can't make Icon Pack work(I've chosen react but my js files are still having normal javascript icon), and I understand problem with local workspace settings. But if you install "VSCode Icons" file icon theme, you will see that extension will honor vs code "files.associations" setting, which you can set *.js files to "javascriptreact" and your icons for .js files will be changed on the fly without restart(works in both workspace setting and global one), can you make this happen?

Any chance we can revisit this? Anything I can do to help with it?

I recently tried to work on this feature. The conclusion from my side was that it's still not really feasible, because all workspaces are using the same global icon configuration which is stored in the central extension folder. So it would be possible to load the workspace settings and to adjust the icons without reloading (for some settings). But if you've multiple workspaces opened at the same time, and open another workspace with different icon settings, it will change all icons of all opened workspaces, too. And this behavior is in my opinion not really nice and may look like a bug. It's still not feasible to implement this feature the way I wish it would work.

Angular and React, as well as others languages use different icons both for files and for folder, it'd be nice if you can configure the "Active Icon Pack" depending the language you're using, an Auto detecting language wouldn't be bad, although I think it too much, so a workspace configuration is ideal in this case, where for projects with differents programming languages you can select an "Active icon pack", for example I configured two different store folders one for redux and one for ngrx, and bind the configuration with the folder association, when easily you can get this by changing the active icon pack, but this implies changing the active icon pack every time you change to a different project language. So it'd be great if you considere again this matter of workspace settings suport

Or add an entry in workspace configuation like "supportMultipleWorkspace": true or "enableIfMultipleWorkspace": true. I don't know how popular multi-workspace is, but supporting workspace settings is really great for people who use workspace settings most of the time.

Workspace settings are not supported yet?
I'm working with NestJS and Angular projects and every time I change between them I have to change my Active Icon Pack.

And .vscode/settings.json of non-workspace folders (I mean folder directly), @PKief ?

How about auto detection ?? " vscode-icons is being shipped with a lot of features, like Project Auto-Detection" I was wonder if there is any chance to make this awesome feature happen???

Any update on this issue?

Not yet...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

covertbert picture covertbert  路  5Comments

JarvisPrestidge picture JarvisPrestidge  路  4Comments

RacerDelux picture RacerDelux  路  3Comments

LiadIdan picture LiadIdan  路  5Comments

stefan-kern picture stefan-kern  路  4Comments