views:

22

answers:

0

Hello everyone,

I'm working on a plug-in which provides easy navigation to some code lines within VS, and the lines I have firstly identified may be invalidated by user updates to the code, (ex. I firstly have line number 3 of HelloWorld class and user inserts two more line before line 3 making my interested line #5). So I'm planning to address this by navigating to the code location through bookmarks (which monitors user line inserts updates) so that navigation works fine even after user edits.

The problem I have now is creating proper bookmarks. I tried using textSelection.SetBookmark(); but this only creates the bookmark in the buffer so it's not maintained in the .suo user file and it doesn't work when file is not already open to navigate.

How can I create books marks to appear in Bookmarks window(View->Other Windows->Bookmark Window) melodramatically, with filename and line number(preferably with a name too), and use it later to navigate to code location ?

Thanks, Chathuranga