DotJoshJohnson / vscode-xml

XML Tools for Visual Studio Code
MIT License
320 stars 87 forks source link

Exclude some XML files from formatting #389

Open shiraze opened 4 months ago

shiraze commented 4 months ago

Description I have "auto-format on save" turned on in VSCode. I also have some XML files, with an "myd" extension that I don't want to be formatted when I make a change, e.g. I want to change a node value but don't want the whole XML file reformatted. Can I exclude some files (based on extension) from formatting when saving?

Current Workarounds I have to change the "Language mode" to "Ignore" before making changes. After saving, I then change back to "XML" for helpful colour coding. Alternatively, I disable this extension: I get the useful colour coding from VSCode, and don't have files reformatted on Save, but I can't selectively format XML that I would like to format.