Some months ago I observed that angular-cli or Visual Code is saving my files after short delay. Which causes recompiling a project and refreshing a page. It is useful but frustrating a bit to wait couple of seconds every single time for refresh. Even after just opening a file. So, the solution that just hit me is very simple. Go to Preferences/Settings, in Workspace Settings put
"files.autoSave": "off"
That's it! Now your project will be compiled ONLY after you hit save.
To turn on or turn off the Auto Save feature in Visual Studio Code, go to File and click on Auto Save from the drop-down menu: The steps are completely the same in Windows and macOS. If you want to config the Auto Save behavior deeper, go to: Mac: Code > Preferences > Settings.
Starting with 17.2 Preview 1, the new autosave feature will help with this. Use Visual Studio Search (Ctrl+Q) and look for “autosave”. That will take you to the Environment\Documents page in Tools\Options.
Go to File-> Preferences ->settings
choose your auto save option from commonly used settings
As @Alex Varghese mentioned in his answer you can do it in the settings. One addition is even if you turn off the auto save option in your user settings, that will not over write the option you have under Workspace settings, so you have to do the changes there as well.
You can also do this changes by going to the settings.json which usually resides at C:\Users\user\AppData\Roaming\Code\User
.
"files.autoSave": "off"
To edit your Workspace settings, you need to edit the settings.json file which resides at the .vscode folder of your solution.
"files.autoSave": "off"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With