Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bookmarks.json missing #237

Closed
TINS12 opened this issue Sep 23, 2019 · 10 comments
Closed

bookmarks.json missing #237

TINS12 opened this issue Sep 23, 2019 · 10 comments

Comments

@TINS12
Copy link

TINS12 commented Sep 23, 2019

Hi,

I couldn't find bookmarks.json either in my roaming directory or in my workspace directory.

I'm using VSCode in Windows, and have a workspace with multi-root folders.

Please let me know where my bookmarks.json is stored.

@alefragnani
Copy link
Owner

alefragnani commented Sep 23, 2019

Hi @Ba-2 ,

The bookmarks.json is available only if you use saveBookmarksInProject as true. It will be saved inside the .vscode, in the root directory. Otherwise it is saved in VS Code internals (used to be in Chromium/LocalStorage, and I think now is in AppData\Roaming\Code\User\workspaceStorage\xxxx\state.vscdb, but I'm not sure).

But, if you have a multi-root project, this setting is not supported, yet, so it will always be saved in VS Code internals.

Just out of curiosity, why do you need access to bookmarks.json file?

Hope this helps

@TINS12
Copy link
Author

TINS12 commented Sep 24, 2019

Thanks Alessandro. I moved some files between folders and I find the bookmarks I saved before the move missing. I thought I'll modify the path in the bookmarks.json if I could find where it is located.

I tried checking the VSCode internals Local Storage, and I couldn't find any files listed there.

@alefragnani
Copy link
Owner

Oh, I see. Well, the extension will ignore the missing files, and will not show/update the bookmarks from files that you moved/deleted/renamed, unfortunately.

I think the state.vscdb file is a SQLLite database. You may be able to load it with any compatible viewer

Hope this helps

@TINS12
Copy link
Author

TINS12 commented Sep 25, 2019

Thanks. I'll give that a try.

@ivangretsky
Copy link

@alefragnani
Is there a way to list all those bookmarks or at least to clear them? I got bookmarks in many different remote projects stored in VS Code internals, and I didn't find a way to list the, in a local VS Code, not opening all the remotes 1 by 1.

@alefragnani
Copy link
Owner

Unfortunately not. There is no command for that.

The Bookmarks are stored separately for each workspace by VS Code, and one can’t access the other.

There is an open issue #287 , asking for a global approach for bookmarks, which could partially fit your need. Why partially? Because you pointed out remote projects, and I have the feeling that remotes wouldn’t be supported, specially because the connection would depend on the remote extension/protocol itself, not the Bookmarks extension.

If #287 is what you are looking for, please upvote the issue, so I’m able to see how required the feature is.

Hope this helps

@ivangretsky
Copy link

I like that idea! But it will be another option, not a replacement for current mechanism. So the data buried in VS Code internals kind of still worries me. Will it stay there forever? Or maybe I should just forget about it)

@alefragnani
Copy link
Owner

Yes, an option, not a replacement mechanism.

Out of curiosity, why are you worried about the data? Performance concerns, security concerns? Other concerns?

@ivangretsky
Copy link

Out of curiosity, why are you worried about the data? Performance concerns, security concerns? Other concerns?

I guess all of that. But most of all is having something beyond my control)

@alefragnani
Copy link
Owner

Well, the way the Bookmarks extension stores its data/state is the same way not only other extensions do that, but VS Code itself. In fact, is the way VS Code proposes to do, via its APIs. In the end, if you have concerns about that, you may have concerns with VS Code itself too.

Maybe, in this case, you should use the Portable Mode. Every VS Code data will be under your control. But yet, separated on each workspace, as every other extension that stores info about the workspace.

Also, VS Code internals are SQLite databases so, you could create a shell script and clear every workspace once, and switch the extension settings to store bookmarks in workspace. Then, the bookmarks will be under your control in the workspace.

Another alternative would be not store bookmarks between sessions, so whenever you close VS Code, the bookmarks are gone. If that's a solution for you, feel free to open a new issue requesting that.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants