lishu / vscode-svg Goto Github PK
View Code? Open in Web Editor NEWA vscode svg langauge support extension
License: MIT License
A vscode svg langauge support extension
License: MIT License
In the first place thank you very much for this VSCode extension. It really is very useful. I have run into one issue which I find rather bothersome. When you run raw SVG markup through Pretty SVG the process strips out the ID tag. I use my SVGs inline in HTML documents and need to manipulate the image elements by accessing them via the ID tag. I imagine I will not be the only one doing this. Could you either stop this from happening or else provide flags to control just what gets removed when Pretty SVG is run?
Like the minify command but send --pretty to SVGO instead of minifying plugins.
Frankly, I don't like any of the formatting options this extension provides; it completely mangles my files into something much less readable. Unfortunately, I can't just turn it off. There's a setting for switching off the plugins, but some formatting still appears to happen when I save (with format-on-save turned on).
如题
I love coding svg directly with vscode. I like the code formatting abilities 'on save'.
Unfortunaltely I found that on some circumstances the file content disappears on format/save. Editor and File are empty. This can be reverted [ctrl] [z] but it is annoying.
Some reasons for disappearing:
For now I turned of 'format on save' but I suggest the behavoiur of other formatters:
Thanks in advance.
ervin
P.S. This might also be related to some other svg plugins, therefore I mention them:
Hello,
Is it possible to change the tab size? The default one that Pretty SVG
formats the file with is of size 4. I want to change it to 2.
How can I change that?
It would be great to have the ability to turn off the grid of the transparent background. It would also be great to have the ability to override the white background color with a custom color.
Integration of SVGO features is really great idea, but binding it as default format provider [1] for SVG syntax seems quite unfortunate to me and might be even dangerous: for example it removes (locally) unused symbol
s, removes comments and generally alters source far more than plain "Format Document" should. For example document
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="a" viewBox="0 0 32 32">
<circle r="10"/>
</symbol>
</defs>
<!--
<use xlink:href="#a"/>
-->
</svg>
after formatting with the default confing becomes:
<svg xmlns="http://www.w3.org/2000/svg">
<!--<use xlink:href="#a"/>-->
</svg>
what does not seem right. (To get "proper" outcome now one must switch syntax to XML, then invoke "Format document" and switch back.)
I think that only alterations expected from the "Format document" command are indents and line breaks. Not optimizations.
From a quick glance at .svgo.yml [2] it seems that there should be disabled far more plugins in [1] to get simple white-space-wise formatted output. (Perhaps.)
So I'd suggest exporting current formatting / optimizing functionality to a new command and simplify the one used for (expected) simple white space format.
[1] https://github.com/lishu/vscode-svg/blob/master/src/features/svgFormattingProvider.ts
[2] https://github.com/svg/svgo/blob/master/.svgo.yml
When I start my VS Code then I see the following warnings:
[~\.vscode\extensions\jock.svg-0.1.5]: Couldn't find message for key configuration.pretty.plugins.description.
[~\.vscode\extensions\jock.svg-0.1.5]: Couldn't find message for key configuration.pretty.plugins.title.
The description is missing in the nls json and you can see that it's missing in the configuration:
Does this work with HTML files, if not that would be a great feature, I rarely work directly with SVG, but I modify SVG inline in HTML files every day.
Hi,
Would it be possible to change the SVG Preview tab to have a white/gray background (like this https://vignette2.wikia.nocookie.net/tome-of-the-sun/images/5/57/Transparent_Background.png/revision/latest/scale-to-width-down/640?cb=20160121033835)so that white SVG's can be shown?
Thanks in advance!
It would be great to be able to zoom in on the preview image. It would also be great if there was an option to auto-zoom when previewing small images.
It would be neat to have path
/glyph
d
attribute value highlighted so that commands, coordinates, lengths, angles and flags would be more apparent.
I assume it should be possible; the only danger I see are omittable consecutive commands.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.