Vscode-bookmarks: Auto-migrate bookmarks when turning on `saveBookmarksInProject`

Created on 14 Oct 2019  路  6Comments  路  Source: alefragnani/vscode-bookmarks

I've renamed the project and now all bookmarks are gone. Where does it store them?

enhancement

All 6 comments

I renamed it back and they reappeared. However I do need to rename it for local consistency. Is there any way to export them for example? I tried to set bookmarks.saveBookmarksInProject to true, hoping that it will auto-move them to some local dump file, but they simply disappeared again.

I think for the first switch from _false_ to _true_, it should check if bookmarks.json file exists and if it doesn't migrate all bookmarks from the workspace state to bookmarks.json.

Hi @jayarjo ,

VS Code stores session's data for each folder/project/workspace, using it's path as key. If you rename the folder, it will understand _as another session_, and that's why the bookmarks weren't there. When you restored the folder name, it could find the session's data and the bookmarks appeared again. In this case, there is nothing I can do to help, because it's the VS Code which didn't recognised the previous session.

About using the bookmarks.saveBookmarksInProjects, if you change the setting's value AND fire any command that updates the bookmarks (add/remove a bookmark, move lines in documents that contains bookmarks) the bookmarks _are migrated_ to bookmarks.json file, and you will not _lose_ anything. But, in this case, _you have to force changes_. Otherwise, if you change the setting and simply reopen the folder, the bookmarks are not updated, and it will try to load bookmarks.json file in that folder, and it won't find anything.

I agree with you 馃憤 . When you _turn on_ the setting it would _automatically migrate_ the bookmarks. Thanks for your suggestion!

Hope this helps

Oh, I wish I had searched for bugs/enhancements for Bookmarks. I was trying to find where the bookmarks are stored so I could copy them over to another machine, but I couldn't find the file that contains the bookmarks.

I then tried the "saveBookmarksInProject" then poof, all my bookmarks that I had created for the past year were simply gone.

I used VS Code via the remote feature. I can't find the bookmarks.json file anywhere, either on the host machine nor the remote machine. I can't believe the bookmarks are not automatically re-saved.

Hi @EmbeddedBacon ,

I'm sorry to hear that. I had experienced the same problem myself a few times, without understanding why. Then, this issue has been opened, and I finally figured out why. Unfortunately, I don't think there is a way to restore the bookmarks 馃槥 .

Just out of curiosity, the bookmarks are stored in VS Code session storage, which is locate in %appdata%/Code/Users/workspaceStorage/SomeHexaValueNumber (inside a SQLite database, if I remember correctly), for each folder that you have opened in VS Code. Previously, it was stored in Chromium LocalStorage (Toggle Developer Tools).

The extension doesn't support _remotes_, yet, but you are able to install it on the remote, and the location where the bookmarks are stored should be the same (on remote, obviously). This is one of my priorities for the extension.

Hope this helps

Thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  5Comments

fgarcia picture fgarcia  路  6Comments

longv2go picture longv2go  路  6Comments

bartosz-antosik picture bartosz-antosik  路  7Comments

versionsix picture versionsix  路  4Comments