ADS: Why doesn’t the app ask to save anything when I close it?

Azure Data Studio has many great features and even more if you add all the extensions that are available.  Many extensions are very useful now, even though they are still in preview.  These features are naturally compared to SQL Server Management Studio.  One feature I like that sort of exists I SSMS is the auto save feature.  This feature will automatically save your files when you close Azure Data Studio and will be there the next time you use ADS.  SSMS has the auto recovery option, but is works a bit differently so it isn’t quite the same. ADS has a setting named “Files: Hot Exit”.

If you open Settings and then do a search on “save”, you will see a few settings returned.  The one we are looking for is under “Text Editor” then “Files”.  When you click files you will see the setting at the bottom.

When you click the drop down box you will see three options, Off, onExit and onExitandWindowClose.  What I like about it is that as you float your cursor over each option, a description appears below it. As you can see below, onExit is the default option.

According to the documentation from Microsoft, these are the descriptions of the three options, these are directly from Microsoft here.

      • "off": Disable hot exit.
      • "onExit": Hot exit will be triggered when the application is closed, that is when the last window is closed on Windows/Linux or when the workbench.action.quit command is triggered (from the Command Palette, keyboard shortcut or menu). All windows with backups will be restored upon next launch.
      • "onExitAndWindowClose": Hot exit will be triggered when the application is closed, that is when the last window is closed on Windows/Linux or when the workbench.action.quit command is triggered (from the Command Palette, keyboard shortcut or menu), and also for any window with a folder opened regardless of whether it is the last window. All windows without folders opened will be restored upon next launch. To restore folder windows as they were before shutdown, set window.restoreWindows to all.

While this feature may give the perception that the changes were saved, in reality the file on disk has not changed at all.  The image below shows a change to the word “Total(s)”.  The top Totals is the word in Azure Data Studio after a change and after a close of the ADS.  The bottom one is from the file that was opened in SQL Server Management Studio, notice there is an “s”.  This shows that despite ADS persisting the change when ADS is restarted, but actual file was not changed.

I really like this option.  Not only will it “save” the files, but it will also save any text you have selected.  If you have a block a text selected and Azure Data Studio is closed, your text will also be selected when you restart Azure Data Studio.

This will not only save your files, but it will also save a number of other items that you may have open.

If you have the Settings open when ADS is closed, it will also be open when reopen ADS.  Although you may not be in the same place in Settings when you return.  If you have the connections window open, this will also be open when reopening ADS.  Like Settings, you may not be in the same place in Connections when I reopens.

Although there might be some Settings you might want to change, for me personally I don’t think this one should be on the list of things to change.

Thanks for visiting my blog!!!