tintinweb / vscode-inline-bookmarks

Customizable inline Bookmarks for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=tintinweb.vscode-inline-bookmarks
GNU General Public License v3.0
45 stars 14 forks source link

inline-bookmarks within workspace-cache cannot be removed #45

Closed smallscript closed 2 years ago

smallscript commented 2 years ago

Kudos, Very nice tool, thank you for the work.

Issue AFAIK inline-bookmarks is using the workspace-cache to retain bookmarks pojo. Therefore when switching workspace/projects there is no option to reset/filter to the active workspace. I.e., it seems to forever retain all bookmarks as long as their file exists even if they are not part of the workspace.

This may be intentional. However, if so, then something like "refresh" or "find" should provide some way to CLEAR stale bookmarks to EXISTING files which are NOT within the workspace projects unioned with any open-editors.

smallscript commented 2 years ago

p.s., I have verified this and within my VsCode I patched the refresh-workspace command to begin with

this.controller.bookmarks = {};

which properly/adequately allows manual cache flushing whenever the magnifying-glass icon is clicked.

tintinweb commented 2 years ago

Hey @smallscript,

did you try this command? This should clear the workspace cache

image

tintinweb commented 2 years ago

some more information:

we're caching bookmarks in the workspace context. This means, if you switch workspaces you're using another cache specific to that workspace. There shouldn't be any files from the previous workspace. This, however, might be more complex if you're using a multi-workspace setting or if you are removing files outside of vscode. Currently, when refreshing, we do not check if the files still exist on disk (note that some files might just be in memory and not even exist on disk). For files outside your workspace you might still want them to show up in the view (because e.g. they're in an active editor window). Resetting the cache at this point would remove these bookmarks.

Looks like fixing this might be a little more complex. Would be great to get more input on how users want this to work 🤔