When I use VSCode to edit some file in a folder (e.g. by invoking code -n .) then after doing something WITHOUT setting any bookmark it insists on creating .vscode\bookmarks.json with (I presume) empty content which is:
{
"onDidClearBookmarkEmitter": {},
"onDidClearAllBookmarksEmitter": {},
"onDidAddBookmarkEmitter": {},
"onDidRemoveBookmarkEmitter": {},
"onDidUpdateBookmarkEmitter": {},
"bookmarks": []
}
Could it maybe refrain from creating it?
It results in having multiple .vscode folders in random places with just "empty" bookmarks.json in them.
Hi @bartosz-antosik ,
This file (.vscode\bookmarks) should be created only if you have bookmarks.saveBookmarksInProject set to true, otherwise, the bookmarks will be saved in VS Code storage area. If you don't want to have the Bookmarks saved with your projects, you should set to false. If you _want_ to have the Bookmarks with your project, the file will be there.
But, it is not _checking_ if there is _no bookmark_ to be saved, and it is still saving the file ๐ข .
I want to refactor the storage structure to support other features, like #36 and #76, and was waiting for this to _wipe_ this empty files. I'm thinking about these being the next features to be added.
Hope this helps
Thanks for the hope! I want definitely bookmarks in workspace context, but would love if they would not create an empty file. Would probably be better not to create the file than wipe it (if I understand wipe correctly) because in many situations there is no .vscode folder and I would love it to stay so when there is no bookmarks.
P.S. If you store bookmarks in VSCode storage then it will not work with Portable (unofficial) edition of said VSCode. I had a similar issue some ago #53. I have no idea if anybody cares, just notifying.
I am sorry to say, but it seems it still does write empty bookmarks.json. Have I understood correctly that it should not anymore after version 0.19?
๐ you are right ๐ .
I was so focused on _deleting_ the empty bookmarks.json file when removing the bookmarks that I totally forgot to check while _changing_ the file.
โ
If you remove all bookmarks, it will delete the bookmarks.json file.
๐ด But, if you type/change any document, it will recreate the _empty_ bookmarks.json file.
Can you confirm the scenarios?
Indeed. When I add/remove bookmarks the file appears on first bookmark added and disappears on last bookmark removed. But when I create a new file & modify it OR modify an existing file bookmarks.json appear and when I save the file it disappears, sometimes (and sometimes not???).
Hi @bartosz-antosik , is it _really_ fixed? ๐
Seems so! Many thanks. If there will be anything related I will report here.