mre/vscode-snippet

Lost my snippets data during syncing.

LazyKnightX opened this issue · 2 comments

I want to know where does this extension store my snippets data?
Can I recover it or where to find my data?

image

image

Hi

Regarding the data loss:

could you please briefly describe how the loss happened? If you used vscode sync, you can try to restore snippets by using vscode's built-in backup mechanisms: https://code.visualstudio.com/docs/editor/settings-sync#_restoring-data

Regarding where the data is stored:

Vscode has a state.vscdb file. On my machine (Ubuntu Linux), it is located in ~/.config/Code/User/globalStorage/state.vscdb.
To inspect the content of this file, you can use any tool that can open SQLite, for example, you can go to this website: https://inloop.github.io/sqlite-viewer/, upload the file and type the following command:

SELECT * FROM 'ItemTable' WHERE key like 'vscode-snippet.snippet'

then click "Execute".
image
You should find a single row with key vscode-snippet.snippet and value equal to json. This json is where snippets are stored.

Thank you for the help, VladBrok.

The situation happens:

  1. I enabled my home computer's vscode sync, which does not contain snippet data.
  2. I went to the company.
  3. I enabled my work computer's vscode sync.
  4. My data was replaced by my home computer's data, which does not contain snippet data.

I restored my data successfully by using the vscode's built-in backup mechanisms.

Your snippet extension is the best one I've found in those years, I really enjoy it.
Cheers! 👍