Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bookmarks #393

Open
LeeMSilver opened this issue Jun 19, 2024 · 0 comments
Open

Bookmarks #393

LeeMSilver opened this issue Jun 19, 2024 · 0 comments

Comments

@LeeMSilver
Copy link

In the current extension model Bookmarks are accessed/created/deleted via the EditPoint2 Interface in EnvDTE880.

The new extension model has no need for EditPoint2 due to the use of ITextDocumentEditor.

My extension uses Bookmarks in 2 scenarios.

  1. One of its commands iterates thru the source-files opened in VS and Bookmarks those have a different namespace than the first file checked.

  2. Code similar to the following pseudo-code:

     CompilationUnitSyntax root = ...;
    
     EditPoint2 epTop = StartOfDocument();
     EditPoint2 epEnd = EndOfDocumentX();
    
     epTop.Delete(epEnd);
     epTop.Insert(wRoot.ToFullString());
    

causes all Bookmarks in the document to be deleted.
The extension does the following to minimize the effect of the deleted Bookmarks:
a) prior to the above code it saves the line-numbers of all Bookmarked lines
b) following the above code it tries to set Bookmarks on the saved line-numbers

I'm fairly sure the if the content of ITextDocumentEditor is completely replaced all existing Bookmarks in the document will also be deleted.

If by some miracle the above statement is not true, (2) above will no longer be a problem, but (1) still needs to be implemented.
How can I accomplish the above without using EditPoint2 either now or in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant