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

Custom SVG icon setting appends random number to the end makes it not found #827

Closed
gencer opened this issue Sep 2, 2020 · 3 comments · Fixed by #829
Closed

Custom SVG icon setting appends random number to the end makes it not found #827

gencer opened this issue Sep 2, 2020 · 3 comments · Fixed by #829
Labels

Comments

@gencer
Copy link

gencer commented Sep 2, 2020

This is how my structure looks and svg icon located:

.vscode
 ┣ extensions
 ┗ icons
   ┗ my_icon.svg

In the settings.json the icon can be associated to a file name or file extension like this:

"material-icon-theme.files.associations": {
    "my.yml": "../../../icons/my_icon"
}

However, In console I get following error:

GET file:///C:/Users/gence/.vscode/icons/my_icon~185020693.svg net::ERR_FILE_NOT_FOUND

As you can see instead of my_icon.svg it says my_icon~185020693.svg. And this number changes on every reload/save.

And file icon becomes empty.

@gencer gencer changed the title Cusatom SVG icons appends random number to the end makes it not found Custom SVG icon setting appends random number to the end makes it not found Sep 2, 2020
@PKief
Copy link
Owner

PKief commented Sep 2, 2020

Oh, could you please post your other settings for the material icon theme? It might be if you set the opacity or saturation of an icon to something else than the default value then it could break the ability to add custom SVG files 😳

@gencer
Copy link
Author

gencer commented Sep 2, 2020

@PKief Exactly! I use that settings. Let me show you full settings:

    ...
	"workbench.iconTheme": "material-icon-theme",
	"material-icon-theme.activeIconPack": "react_redux",
	"material-icon-theme.folders.color": "#ff7043",
	"material-icon-theme.hidesExplorerArrows": false,
	"material-icon-theme.saturation": 1,
	"material-icon-theme.files.associations": {
		"my.yml": "../../../icons/my_icon"
	},
    ...

However, I've removed saturation and still not worked out.

EDIT: It seems also folders.color affects that too. It now works without folders.color and saturation

How can we get around this together with those options?

@PKief PKief added the bug label Sep 2, 2020
@PKief
Copy link
Owner

PKief commented Sep 2, 2020

Thank you, yes it currently affects all settings which produce some changes to the SVG icons itself.

A workaround is to remove all settings that change the SVG icon:

  • material-icon-theme.folders.color
  • material-icon-theme.saturation
  • material-icon-theme.opactiy

The root cause for adding the numbers after the icon name is that it triggers the automatic reload of all icons when e.g. their color has been changed. One solution would be to append these numbers to the custom icons, too. The other solution would be to simply ignore custom icons. I will investigate a solution soon.

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

Successfully merging a pull request may close this issue.

2 participants