From what i understand any work you do in application is stored in ram (until you save it), so if your computer shuts down before saving (to the hard drive) your interim work won't be saved. But i didn't observe this while working in VS Code; i.e. work that i didn't save before shutting down(i did force shutdown a couple of times) on my computer is back there when i restart my computer (in unsaved mode too!). How is this happening?
How does VS Code restore files with their changes that I didn't save before closing the application?
Asked
Active
Viewed 315 times
1
-
Is this correct space/website to ask this question on? Please comment any other suggestions , if any. – Saurabh Agrawal May 10 '19 at 11:23
2 Answers
1
There seems to be a cache inside VS Code. Refer this question : Recovering file from the Visual Studio document cache?
I think it just restored the unsaved code from the cache. If you read the above question carefully you will see there are even known bugs with it.

heatstreak
- 121
- 3
0
This is VS Code's "Hot Exit" feature. See the official docs on the feature at https://code.visualstudio.com/docs/editor/codebasics#_hot-exit. TL;DR VS Code remembers unsaved changes when you close the application and restores them when reopening those files. You can control that behaviour with the related files.hotExit
setting.

starball
- 20,030
- 7
- 43
- 238