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

[FEATURE] - Allow bookmarks.json save location to be specified per workspace folder #600

Open
SudoCerb opened this issue Mar 29, 2023 · 3 comments

Comments

@SudoCerb
Copy link

I have a workspace with three different repositories. I enabled Save Bookmarks In Project but this saved a new bookmarks.json file in one of my repos under .vscode (seemingly the first one it found alphabetically), but I was not working in that repository at the time, and don't want bookmarks to live there.

Would it be feasible to configure a bookmarks.json file per workspace folder or git repository?

@SudoCerb
Copy link
Author

I've read that there's improved multi-root support but it's not clear how I would use that to solve my issue.

@alefragnani
Copy link
Owner

Hi @SudoCerb ,

First of all, sorry for the late reply.

About the behavior, if you have enabled saveBookmarksInProject in the multi-root workspace level (directly in the your-workspace.code-workspace file), a individual .vscode/bookmarks.json file should be used for each folder, containing the bookmarks of that folder. This is the similar behavior as VS Code itself, while handling folder settings on multi-root workspaces, which handles individual .vscode/settings.json file, on each folder. The same behavior should be seen if you enable saveBookmarksInProject at user settings level.

However, if you set saveBookmarksInProject in one individual folder within that multi-root workspace, it will be ignored, for that multi-root workspace. It only works if you open that folder separate, in an individual windows.

But, there is one caveat, and maybe this is what happened to you. If you:

  • have saveBookmarksInProject disabled at user settings level
  • opens a multi-root workspace
  • toggles a few bookmarks on each folder, and
  • decides to change saveBookmarksInProject setting to true
  • the first folder in the multi-root workspace will be the only one to receive its bookmarks, if there is any

I think a fix for this would be effectively split the bookmarks, and save them on its own root-folder

The hard part (in the bookmarks.json matter) for multi-root workspaces is that you may have your .code-workspace located anywhere, away from the original root-folders contained in that multi-root workspace. So, to saveBookmarksInProject for multi-root workspaces, the only reasonable location is inside the root-folder itself.

Hope this helps

@alefragnani
Copy link
Owner

BTW, I'm not inclined to the external location management for bookmarks, like #685 for instance, simply because it would be necessary to replicate a session management feature, like VS Code already does today.

I think what would happen if the user selects a network location, or even shared locations (two users sharing the same bookmark files) would be another thing to worry about.

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

2 participants