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

existing bookmark's line number should change as new lines added/deleted #362

Closed ferencdg closed 3 years ago

ferencdg commented 3 years ago

Hi,

thanks for the extension. Let's say I put a bookmark on line 100 and currently the text on that line is 'void function();', and new lines added/removed and that specific line's value didn't change. Could the line number change for the existing bookmark too? Right now I keep have to redo my bookmarks as I am editing the file, even though content of the line didn't change, just new lines added/removed.

thanks

alefragnani commented 3 years ago

Hi @ferencdg ,

The extension does that. It's what I call sticky behaviour. But there are some cases where it is not working perfectly yet ands still needs some work, like:

In both cases, there are open issues like #116, #168 and #118.

Hope this helps

ferencdg commented 3 years ago

somehow from VS code extension panel when I install Bookmarks I can only install version 11.4, but github says 12.0 is already out... is this feature also in 11.4?

maybe this feature doesn't work for me in 11.4 because of some plugin conflicts(I am using D language btw, but even with C++ it didn't work for me)

alefragnani commented 3 years ago

No, it works this way a long time ago.

I'm not sure if the D or C++ extensions you use has auto-format or something like that. If yes, it must be the reason.

Version 12.0 was released almost a month ago, in Nov 24th. Version 11.4 a month earlier in Oct, 16th. Maybe the marketplace service was off/unstable when you tried to install/update, because right now, it returns 12.0 inside VS Code and on Marketplace https://marketplace.visualstudio.com/items?itemName=alefragnani.Bookmarks.

trevyn commented 3 years ago

Another option is recognizing the content of the line, like this extension: https://marketplace.visualstudio.com/items?itemName=tintinweb.vscode-inline-bookmarks

The downside of that extension is that you need to add specific marks in your file content.

Perhaps some sort of hybrid would be best...

alefragnani commented 3 years ago

Hi @trevyn ,

That's a totally different approach. In this case, the extension don't need to keep track of file changes but instead just rerun the parser (which locates the tags), when changes are made.

Here, on the other hand, there is nothing to parse. The bookmarks needs to be updated, based on the changes VS Code publishes.

alefragnani commented 3 years ago

Closing as duplicate of #116, #118, #168