alefragnani / vscode-bookmarks

Bookmarks Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks
GNU General Public License v3.0
1.7k stars 163 forks source link

[BUG] - refresh button not working as expected #516

Closed argankur closed 2 years ago

argankur commented 2 years ago

when I bookmark code for any flow in my project, I take a copy of the .vscode/bookmarks.json file and clear all bookmarks, and start bookmarking for another flow. Now if I want to again switch back to the flow1 bookmarks I would copy-paste the content of the bookmarks_flow1.json into the original .vscode/bookmarks.json file, save it and press the refresh button on the extension. But the bookmarks don't refresh. It only refreshes according to the .vscode/bookmarks.json file when I reload the vscode. Steps to reproduce

  1. using SSH remote extension to access my workspace hosted on Linux server
  2. bookmark a few files/code lines
  3. copy the content of .vscode/bookmarks.json to somewhere
  4. clear all bookmarks and bookmark for another flow.
  5. to switch back to the previous flow, copy the backup content and paste in .vscode/bookmarks.json
  6. press refresh (expectation is that the bookmarks should be refreshed as per .vscode/bookmarks.json)
  7. upon reloading vscode, the bookmarks will be refreshed according to the content of .vscode/bookmarks.json

Is there any other way we can use bookmarks extension to fulfill my use case?

alefragnani commented 2 years ago

Hi @argankur ,

The refresh button is not meant to reload the bookmarks from the file system, but only update the Side Bar, in the case something is out of sync, like file renaming and sticky issues.

The file system (bookmarks.json and VS Code internal storage) are loaded only when the workspace is opened. So, for your use case, the only way to load your flows is using the Reload Window command

I think another open issue (#254), would fit your scenario, because you could easily switch between sets/tags. Take a look at https://github.com/alefragnani/vscode-bookmarks/issues/254#issuecomment-914523838 for more details on how it is planned. Feel free to upvote/add comments on that.

Hope this helps