Table of Contents
How to enable auto save in vs code ?
Did you know that you can now activate Auto Save coding on VSCode ( Visual Studio Code ) for Business Central AL Programming? Surprisingly, this feature has been around for quite some time. Yet, in conversations with many tech enthusiasts, I discovered that most are still unaware and sticking to the old Ctrl + S method for saving code. If you’re just diving into the Auto Save feature in Visual Studio Code, fret not about manual saves! This is a game-changer, preventing those code losses that occur when we forget to save by default.
VS Code acts as a versatile and powerful code editor for seamless development. By default, whenever you try to close the coding window, it will throw a popup message prompting you to save the code, like the following.
How to Activate Auto Save in VS Code
You may activate vscode automatic save using any of the following options
Option1 : Auto Save Activation From File Menu
This is the easiest method to activate the Auto Save option in Visual Studio code AL coding platform.
In order to activate the Auto Save feature using this method, go to File -> Save option as shown in the following image. By default, the Auto Save option with the selection will not be visible. However, when you click on it, it will allow you to activate the feature. Similarly, clicking again will deactivate it.
Before VSCode Auto Save Activation
After VSCode Auto Save Activation
Option 2 : VSCode Auto Save Activate from Visual Studio Code Settings
This is the second type of activation of Auto Save feature on VSCode AL program.
VS Code Setting Opening
Auto Save Activation Setting
files.autoSave can take the following values:
off: Disables auto-save.
afterDelay: Saves files after a configured delay (default 1000 ms).
onFocusChange: Saves files when focus shifts away from the editor of a dirty file.
onWindowChange: Saves files when the focus moves out of the VS Code window.”
Option 3 : Auto Save Activation Using settings.json file
For activating using this option you open settings.json file and then required to add following set of code.
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 1000
file auto save can following option this settup as well.
off: Disables auto-save.
afterDelay: Saves files after a configured delay (default 1000 ms).
onFocusChange: Saves files when focus shifts away from the editor of a dirty file.
onWindowChange: Saves files when the focus moves out of the VS Code window.”
I hope this content is useful to help you gain knowledge on how to enable AutoSave in the VS Code interface. If you have any further concerns, feel free to comment here.
FAQ : VSCode Auto Save Enabling
You may activated the auto save feature in Visual Studio code using 3 different options. All the options are explained in this post.
Although there are multiple options explained in this post, the simplest method to enable it is from the File menu. Have a view on detailed settings image given on this post.
Easy method to disable or stop auto Save settings on VS Code is from the File->Auto Save option