material-extensions / vscode-material-icon-theme

Material Design icons for VS Code
https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme
MIT License
2.36k stars 668 forks source link

[Bug]: Workspace-level configuration does not work correctly with multiple workspaces open #2962

Open mkacct opened 1 month ago

mkacct commented 1 month ago

Describe the bug

If you have two different workspaces open (in different instances of VS Code), each workspace will not have its own workspace-level icon configuration. Instead, the last loaded one (either last opened workspace or last edited configuration) will apply to all instances.

To Reproduce

  1. Open two different directories in two different VS Code instances (we'll call them A and B).
  2. In workspace A, open .vscode/settings.json.
  3. Add an icon association override for something present in both workspaces. (Ex. set a different icon for the src folder.)
  4. Note that the icon association is reflected in both workspaces.
  5. Also note that any icon associations assigned in workspace B's .vscode/settings.json (if existent) are not currently being applied.
  6. Close and reopen workspace B.
  7. Note that now workspace B's configuration (or lack thereof) is being applied to both workspaces, and the icon association added in step 3 is no longer being applied to either of them.

Expected behavior

I would expect the two workspaces' configurations to each apply only to themselves and not affect other instances of VS Code.

Screenshots

No response

Computer information

Additional context

If this is actually a VS Code API limitation and therefore unresolvable, that would be disappointing but understandable.

Code of Conduct

PKief commented 3 weeks ago

@mkacct thanks for opening the bug ticket. The reason for this issue is that the extension is currently implemented in such a way that the icon configuration and the icons themself are located in the ~/.vscode/extensions directory of VS Code. So if one workspace changes some settings it will be applied in that global extension folder which is affecting all VS Code windows which are open at the moment. I can understand that this is not ideal but I'm currently not sure if there's a good solution for this issue.

We need to do some investigations if VS Code API provides more possibilities for icon extensions to improve that behavior. Currently, I'm not aware of anything provided by VS Code yet.