1000ch / vscode-svgo

Fully featured SVGO extension for Visual Studio Code 🐯
https://marketplace.visualstudio.com/items?itemName=1000ch.svgo
MIT License
72 stars 9 forks source link

Minify SVG files in Workspace #9

Open Vitruvius21 opened 3 years ago

Vitruvius21 commented 3 years ago

When I click on Minify SVG files in Workspace it does nothing. Pops up notification that all SVG files were minified but the code doesn't change.

Am I doing something wrong or it is a bug? image

onetrev commented 3 years ago

Same issue for me too. But I've also had trouble with this command doing some weird stuff to the two SVGs I was testing with. It seems to happen if I have an SVG open then select Minify SVG files in Workspace. It could also be when I try Workspace minifying twice in a row. The first time does nothing, second time there are glitches and the two SVGs look the same, but are different file sizes. It's really odd. I can't seem to figure out exactly what causes the overwriting. Either way, minifying all files in workspace doesn't work -- AVOID.

Minifying one file at a time works perfectly however.

GorvGoyl commented 3 years ago

facing the same issue. Can't minify bulk SVGs.

1000ch commented 2 years ago

Unfortunately, the behavior of workspace.textDocuments seems to be weird. workspace.textDocuments requires workspace files to be opened to include them to return value, and need to open each file in a new tab somehow to manipulate, so that it may not suit for this functionality. Also, I found the related issue.

I may need to disable bulk manipulation features at the moment unless there is another approach. Does anyone know it?