Closed enoversum closed 2 years ago
Hi @enoversum ,
It seems you should use what VS Code calls as Multi-root Workspaces. The extension supports it.
With that, you create a workspace (which is nothing more than a .code-workspace
file) and define this workspace to save bookmarks in project, setting bookmarks.saveBookmarksInProject: true
on workspace level. Then, you add each site/project as a new folder. When you toggle a bookmark, the bookmark will be saved on its own .vscode/bookmarks.json
. When a new site/project is created, you simply add it to this Workspace and its bookmarks will be saved on its own .vscode/bookmarks.json
file.
I suggest you to define the the same bookmarks.saveBookmarksInProject
for each folder, and not only in workspace level, because if for any reason you need to open that site/project alone, you will reuse the same bookmarks.
There is one catch, that I discovered yesterday while testing #461 . It seems the multi-root workspace activation has changed in recent release, so the extension won't recognize a newly added folder automatically. So, when after you add a new folder to your workspace, simply reload VS Code and the extension will properly work. I still don't know if I'll have to update the extension or if VS Code itself will change/fix something, but if I have to change anything, I'll link the issue here, so you will be notified.
Hope this helps
Hello @alefragnani, thanks for your detailed explanation. I think I understand multi-root workspaces, but it doesn't seem like just the thing I want to do. Here is how I usually work:
If I am not mistaken, since I don't have a multi-root workspace, having separate sub-folders with .vscode does nothing for Bookmarks, does it? And that would be my problem then 😊.
Thanks for taking care of me, I really appreciate it!
@alefragnani Just a small follow-up question: Did I assess the situation right, and there is currently no way to have sub-folder based bookmarks, like described above?
@alefragnani Hi there again, just chiming in to ask whether there is any support planned for sub-folder bookmarks instead of only root folder bookmarks? As explained, my bookmarks-equipped theme is in a subfolder of a VS Code project, and changes its name on every project, so I couldn't link it from a root-folder bookmarks file. As previously stated, multi-root projects are not what I need, as all files are in one folder.
I’m mostly developing WordPress themes, based on a skeleton theme that I improve over the years. I can successfully go into its project and set bookmarks in files, and with
bookmarks.saveBookmarksInProject
set totrue
, they are being stored in its.vscode
folder. My workflow is then for every site I build to create a new project, install WordPress into it and copy the base theme (with a new folder name) into my new project, so the theme folder is now a sub-folder of the new project.Since your extension seems to expect me to have the bookmarks.json inside the root of my project (and not in the theme’s sub-folder), my bookmarks do not show up. Is there a way to make Bookmarks recognise my sub-folder
bookmarks.json
? Since the theme folder name changes for every WordPress project, I cannot even prepare abookmarks.json
file in the.vscode
folder.