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

[FEATURE] - Store line content along with line numbers when creating a bookmark. #570

Closed azhar-path closed 1 year ago

azhar-path commented 1 year ago

Working in a large shared codebase, I like to bookmark certain points of interest in the code and revisit them later. The problem is the code can change since it is developed by many people, and now the bookmark points to a line number that no longer has the bookmarked line. I suggest storing the content of the line also in the bookmark so that even if the line number changes you can infer the new position of the code based on the content of the bookmark.

alefragnani commented 1 year ago

HI @azhar-path ,

For shared codebase scenarios, the suggested approach is to use bookmarks.saveBookmarksInProject setting as true, which will make the bookmarks to be stored within the codebase, located at .vscode/bookmarks.json file. Doing so, the bookmarks will be available to anyone, and any changes will reflect in the bookmark.

There are other two open requests (#177 and #370) related to Git, which could fit your scenario as well (if you are using Git).

Otherwise, if you consider any external change, like opening some file with Notepad/VI and make the extension to recognize those changes, it is not tracked yet.

Hope this helps

alefragnani commented 1 year ago

I'm closing this issue because no new comments has been added since my last question.

Thanks for your understanding