Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code backup mechanics

How does Visual Studio Code recover data after a crash? "Crash" includes both sudden power outages and handled exceptions. As examples of what I mean,

  1. Notepad++ has a backup folder which periodically saves copies of your files. Nothing is lost beyond the last 7 seconds even if the power goes out.
  2. Atom keeps an IndexedDB which should recover everything after an exception. I have no idea what happens on power outage.
  3. Inkscape relies on its exception handling to recover data. If the power goes out, the data is lost.
  4. Scite has no backup plan.
like image 594
Kevin Yin Avatar asked Mar 06 '17 21:03

Kevin Yin


People also ask

Does Visual Studio Code backup files?

For previously saved files, Visual Studio 2019 version 16.2 and later saves a copy of the file in %LocalAppData%\Microsoft\VisualStudio\BackupFiles\[projectname]. If the file is new and you haven't saved it yet, Visual Studio autosaves it by using a randomly generated file name.

How does VS Code navigate to previous file?

VS Code provides two powerful commands to navigate in and across files with easy-to-use key bindings. Hold Ctrl and press Tab to view a list of all files open in an editor group. To open one of these files, use Tab again to pick the file you want to navigate to, then release Ctrl to open it.


1 Answers

According to https://code.visualstudio.com/blogs/2016/11/30/hot-exit-in-insiders,

The way hot exit works is to periodically make backups of unsaved files. If VS Code happens to crash, a backup restore will occur the next time the folder is opened.

On Windows, the backup folder is C:\Users\<username>\AppData\Roaming\Code\Backups.

As for the period between backups, I haven't found anything.

like image 104
3 revs, 2 users 92% Avatar answered Sep 20 '22 03:09

3 revs, 2 users 92%