Skip to content
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

Support workspace settings #208

Closed
wopian opened this issue Feb 26, 2018 · 34 comments · Fixed by #1540
Closed

Support workspace settings #208

wopian opened this issue Feb 26, 2018 · 34 comments · Fixed by #1540
Assignees

Comments

@wopian
Copy link
Contributor

wopian commented Feb 26, 2018

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"
}
@PKief
Copy link
Member

PKief commented Feb 26, 2018

@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.

@wopian
Copy link
Contributor Author

wopian commented Feb 26, 2018

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 👍

@PKief
Copy link
Member

PKief commented Feb 26, 2018

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 😉

@deftomat
Copy link

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.

@PKief
Copy link
Member

PKief commented Aug 18, 2018

@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.

@deftomat
Copy link

@PKief Great, thanks for your answer...

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

@yatki
Copy link

yatki commented Feb 21, 2019

@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?

@RodyGL
Copy link

RodyGL commented Feb 23, 2019

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

@PKief
Copy link
Member

PKief commented Feb 27, 2019

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.

@tavrez
Copy link

tavrez commented Mar 13, 2019

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?

@hacknug
Copy link
Contributor

hacknug commented Aug 6, 2019

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

@PKief
Copy link
Member

PKief commented Aug 6, 2019

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.

@Donkijote
Copy link

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

@mayeths
Copy link

mayeths commented Apr 11, 2020

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.

@mrobl3s
Copy link

mrobl3s commented Aug 20, 2020

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.

@gusbemacbe
Copy link

gusbemacbe commented Sep 15, 2020

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

@Tonysmark
Copy link

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???

@JoJk0
Copy link

JoJk0 commented Jan 25, 2021

Any update on this issue?

@PKief
Copy link
Member

PKief commented Jan 25, 2021

Not yet...

@geerdes
Copy link

geerdes commented Feb 17, 2021

I'm alo very interested in getting this work at least in the folder settings... What about using subset of settings for each workspace or folder. Then you can check if subset exists and load icons for all opened workspaces without overwriting the "main" settings. Don't know, if that works, but may be an idea

@cy-long
Copy link

cy-long commented May 2, 2021

really should mention this in the documentation, though.

@ghost
Copy link

ghost commented Jun 25, 2021

I'd greatly appreciate a workspace configuration for icon packs also!
I don't see myself using the global configuration to be honest 😐

@ghost
Copy link

ghost commented Jun 25, 2021

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.

@PKief Is it possible to only apply settings from the workspace that's currently in focus?

@PKief
Copy link
Member

PKief commented Jun 25, 2021

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.

@PKief Is it possible to only apply settings from the workspace that's currently in focus?

Unfortunately, this is currently not possible. Icon themes can only change all icons, regardless which window is opened.

@ghost
Copy link

ghost commented Jun 25, 2021

Can't we bind to onDidChangeWindowState & onDidChangeWorkspaceFolders and dynamically apply workspace configurations based on that?

That way, only active workspaces for the visible windows will have their icon packs applied..

@WillsterJohnson
Copy link

Any chance of using this implementation as a toggleable (default false) option?
For example, in user settings there might be something like

"material-icon-theme.useWorkspaceSettings": true

Which would then enable the use of workspace settings?

It would mean that anyone who doesnt want to use workspace settings is completely unaffected, and those of us who do will at least be able to, even if the implementation needs some restarts.
Maybe label it as an experimental feature so users who havent seen this issue will know that there are some issues with it, especially regarding VSCode restarts etc as was mentioned a while ago.

@ghost
Copy link

ghost commented Jul 18, 2021

I think marking this feature as experimental is ideal.

@WillsterJohnson
Copy link

Just had a read through the issue above, does this mean that (in theory) supporting workspace settings is possible?

@eyk
Copy link

eyk commented Nov 2, 2021

@PKief I don't think this is an issue with the VS Code API anymore.

Vscode-icons perfectly supports Icon configuration per Workspace.
https://github.com/vscode-icons/vscode-icons/wiki/FineTuning

Would be cool if you could finally support it.

@gusbemacbe
Copy link

@PKief

@eyk has confirmed.

I was reviewing your repo, while analysing @telesoho's Markdown Paste

You can replace at the file package.json:

https://github.com/PKief/vscode-material-icon-theme/blob/b76e2e421de19ed9dfed0ff10fe44b200a39aea4/package.json#L124-L142

with

    "configuration": {
      "type": "object",
      "title": "MaterialIconTheme",
      "properties": {
        "material-icon-theme.showWelcomeMessage": {
          "type": "boolean",
          "default": true,
         "scope": "resource",
          "description": "%configuration.showWelcomeMessage%"
        },
        "material-icon-theme.showUpdateMessage": {
          "type": "boolean",
          "default": false,
         "scope": "resource",
          "description": "%configuration.showUpdateMessage%"
        },
        "material-icon-theme.showReloadMessage": {
          "type": "boolean",
          "default": true,
         "scope": "resource",
          "description": "%configuration.showReloadMessage%"
        },
/*... *.
}

You can see @telesco's TypeScript code to enable support for multi-root workspace: src/paster.ts

@Dev-BrunoGomes
Copy link

Hello there, sorry if I missed something and it has already been responded before, but I'm trying to change the icon of the root folders in multiroot workspace. Is there a already a way to do it?

@PKief PKief self-assigned this May 28, 2022
PKief added a commit that referenced this issue Jun 5, 2022
* Update dependencies

* Implement workspace settings (Closes #208)
@PKief
Copy link
Member

PKief commented Jun 5, 2022

Great news: the extension finally also supports workspace settings! 🎉

Tendentially, I would still recommend using the global user settings as often as possible if you want to customize something in the extension. If you jump into another VS Code window that contains different workspace settings, you will notice that it takes a moment for the icon extension to adapt to the new workspace. So if you want to adjust the extension on workspace level, I would recommend to do it only for the File or Folder associations, because it works fastest that way. Well, I'm already writing too much, just try it out ;) I look forward to your feedback!

@badaszszsz
Copy link

badaszszsz commented Jul 26, 2022

Hi @PKief

UPDATE: everything below is crap :) it is working, I just not installed yours but sth else by mistake ;/

Thank You very much for support and delivering this! 🙂

image

I tried:
https://github.com/PKief/vscode-material-icon-theme#folder-themes

on VSCode:

Wersja: 1.70.0-insider (user setup)
Zatwierdzenie: cc098faebd320a2eea3da6ae154b7e2e1347a4b9
Data: 2022-07-26T05:16:55.337Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Windows_NT x64 10.0.22622

and cannot find the setting:
image

Also it is not working for me when I try to put in User settings. To check me - see this:
image

Trying to get this: https://youtu.be/VHhksMa2Ffg?t=1124
Getting this:
image

Thanks for any feedback; would be glad to help and test asap even on hash 🙂👍

@CanRau
Copy link

CanRau commented Jun 23, 2023

can't get it working with custom svg icons, ideally I'd like to store the icon in the workspace .vscode folder

An alternative for me would be official rakkas support #2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.