I'm trying to have synced VS Code instances at work and at home, including the list of open files. I know there are extensions to sync settings, but they do not cover Open Files AFAIK. I do not expect live syncing, under running instance, but if I, say, reboot both machines and start Code on them, I want them identical.
Currently, I have a portable installation of Code on my OneDrive, and I've tried to move AppData\Roaming\Code to OneDrive as well, replacing the actual directories with the symbolic links to this copy.
But still, when I open editor at home it has its own set of Open Files.
I tried to use ProcMon to get an idea where it comes from, I tried to read sources a bit. It seems asking may be easier :-)
Btw, I'm opening in Code git folder of my project. And this folder is located at the same path on both PCs.
1 Answers
Answers 1
I'm pretty sure you're right with AppData\Roaming\Code
being the location in question. Specifically:
AppData\Roaming\Code\storage.json
and in that thewindowsState
section.AppData\Roaming\Code\Backups\workspaces.json
These files (or at least storage.json
) do not get updated until you exit Code (File > Exit). If you are leaving Code open on your work machine and not seeing the changes when you get to your home machine, that might be why you're not seeing the expected.
Code / Atom also stores state information in sqlite3 databases and lots of state information is stored in there:
AppData\Roaming\Code\Local Storage\file__0.localstorage
Use an SQLite browser tool such as http://sqlitebrowser.org/ to open it up. You'll see lots of familiar path references in the table ItemTable
. The column value
shows as "BLOB" (binary) but you can click on any row and export the data to a file. Do this and open up it up in a text editor (e.g. Code! :)) and you'll see it's just a JSON string.
(As VS Code is based on GitHub's Atom editor, searching for issues using "Atom" rather than "Code" often digs up information you might not otherwise find.)
0 comments:
Post a Comment