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

Would it be possible to avoid creation of empty bookmarks.json? #95

Closed
bartosz-antosik opened this issue Feb 23, 2018 · 7 comments
Closed
Labels
Milestone

Comments

@bartosz-antosik
Copy link

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.

@alefragnani
Copy link
Owner

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

@bartosz-antosik
Copy link
Author

bartosz-antosik commented Feb 24, 2018

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.

@alefragnani alefragnani added this to the 0.19.0 milestone Apr 22, 2018
@bartosz-antosik
Copy link
Author

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?

@alefragnani
Copy link
Owner

😞 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?

@bartosz-antosik
Copy link
Author

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???).

@alefragnani
Copy link
Owner

Hi @bartosz-antosik , is it really fixed? 😟

@bartosz-antosik
Copy link
Author

Seems so! Many thanks. If there will be anything related I will report here.

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

No branches or pull requests

2 participants