visual-studio-coderamhard-drive

How does VS Code restore files with their changes that I didn't save before closing the application?


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?


Solution

  • 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.