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
material-icon-theme: change folder color command does not work when the extension is run as a workspace extension #2343
Comments
The extension modifies the icon definition theme file but also the svg-icons it provides (it changes the fill color). Some ideas:
|
@PKief Would you consider using a different file name per generated folder icon? E.g. |
@aeschli I was just elaborating if this would be technically possible. So right now, I do not see any hurdles except the fact that I need to touch various lines of code in my extension. I could definitely try that if it saves you some time ;) |
Sorry for the work on your side. I think it's the most pragmatic change. Officially, resources in extensions are supposed to be static so what your extension does (others do it as well, I know) is not supported . I understand why you do it and there's currently no alternative for you. The proper solution would be a new 'Icon Provider` API, but that's not very high on our backlog. When you make the suggested change, as an additional benefit I believe the 'reload window' is no longer necessary. |
No worries, I can understand that. I put this task on my agenda to work on that soon. And if the 'reload window' is no longer necessary with this approach, it will improve the experience of my extension as well. |
@egamma It is now working with this PR PKief/vscode-material-icon-theme#649 in a remote container: It is also working for the settings 'material-icon-theme.opacity' and 'material-icon-theme.saturation'. The 'reload.window' is not needed anymore, which is really nice! I'll merge it to my master branch and push an updated version of the extension to the marketplace in the next days. @aeschli Is there anything else that should be done from my side? |
@PKief Thaks a lot.
That way your extension will run properly in remote windows as well as in the web without the need for us to override |
Background: the popular theme PKief.material-icon-theme does not work in VSO. One reason is that the extension is configured to be a strict ui extension
"extensionKind": ["ui"]
.When configuring the extension so that it can also run as a workspace extension:
"extensionKind": ["ui", "workspace"]
then the material icon theme is properly applied and rendered. However, the dynamic theme customizations (change folder, change opacity) have no effect. These dynamic theme customization modify the icon definition file and the svgs for the extension. Reloading the window has no effect and these customizations are not honored.To reproduce the problem:
dist/material-icons.json
and regenerates the corresponding folder SVG icons in theicons
folder (e.g. folder.svg). It then informs the user to reload the window.🐛 the change has no effect and the folder color falls back to the default color.
The text was updated successfully, but these errors were encountered: