IMPORTANT - Extension is not working !!!
The extension is not working for XML, HTML, razor, cshtml and other xml like files.
Enables auto formatting of the code when you save a file. Visual Studio supports auto formatting of the code with the CTRL+E,D or CTRL+E,F key shortcuts but with this extension the command 'Format Document' is executed on Save.
Note: I highly recommend you to use EditorConfig. Just create .editorconfig file and install a plugin for your code editor. Here is one for Visual Studio.
You can find the source here: https://github.com/Elders/VSE-FormatDocumentOnSave
Here is a link if you want to know how I built that extension: [https://mynkow.github.io/Visual-Studio-Extensions-Format-document-on-Save/)