Issue #127 (File Auto Save Settings)09/25/24
For some time now, VS Code has included features for 'auto saving' your work, should you choose to enable it. Auto Save is off by default but you can enable it using the
Files: Auto Save setting, which has a few different values, not just "on" and "off".
You can set it to auto save
onFocusChange, which auto saves the file when it loses focus (i.e. you switch to another editor or tab). There's also the option to auto save
onWindowChange, which saves when the window loses focus. This latter option will save all changed open files, but only when the window loses focus. This could be a focus change to another VS Code window or any window in your OS.
There's also an option to auto save
afterDelay. This setting works in tandem with the
Files: Auto Save Delay setting.
The value you enter in milliseconds will determine how long the editor should wait before saving the file when changes are made.
Finally, there are two new auto-save related settings that were added to VS Code earlier this year. These are
Files: Auto Save When No Errors and
Files: Auto Save Workspace Files Only.
These new settings allow you to avoid having files saved that contain errors. This can be helpful if you don't want your external tools that might be 'watching' your files to act on an error-laden file while you're still working on it. The other setting limits the auto save setting to files in the open workspace.
One final setting is on by default, which is
Files > Refactoring: Auto Save, which ensures files that are part of a refactoring are automatically saved, but you can turn that off if you prefer not to have this happen automatically.
Now on to this week's hand-picked links!