alefragnani / vscode-bookmarks

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

[FEATURE] - Bookmark by Tag (or more general: Bookmark by Regex) #500

Closed pawsaw closed 2 years ago

pawsaw commented 2 years ago

Background

Some developers tend to treat the source code as single source of truth.

The "traditional way" for bookmarking is to add a specific comment with a tag (or something similar) which can be searched for, using the editors search capabilities. One very common Tag is the famous TODO. Developers tend to extend this idea and introduce their own Tags.

Proposal

I'd like to propose to introduce a labeled Bookmark by Regex Feature.

The user can add a (multiple) Bookmark(-s) giving a regular expression.

As this feature might be costly in terms of performance I'd like to suggest an Update Bookmarks Button/ Action Trigger.

Thank you for this great extension.

alefragnani commented 2 years ago

Hi @pawsaw ,

The idea behind the Bookmarks extension is that you define the positions which you think to be important, and to do that, you have to be there.

Instead of a new command to add bookmarks based on some regex, I suggest you to do the opposite. Search for any text/regex in the file, and use the multi-cursor feature in extension to bookmark all locations at once.

But, if you need bookmark/tag locations from the entire workspace (not just the active file), I remember seeing a few extensions that uses regex to do that. If I remember correctly, mostly uses the to-do concept.

Hope this helps