How to add / remove code in the code editor from the extension?
For example:
I created an extension that modifies code from an incoming socket. This example uses Microsoft.VisualStudio.Text.Editor
Tried to use:
<code> IWpfTextView textView; // received from the "Create" visual studio event Change ITextChange; // Received from a network socket or other source
ITextEdit edit = textView.TextBuffer.CreateEdit (); // Throws a "Not Owner" exception edit.Delete (change.OldSpan); edit.Insert (change.NewPosition, change.NewText); Code>
But I assume that there is another way, because the CrateEdit () function does not work
source
share