You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, but this involves connecting two component models, R#'s and WPF Text Editor's.
Basically, first you implement the drawing in the 100% Visual Studio way (MEF components, text editor layers, all that). VS will register all R#'s DLLs for MEF, including yours, so it will work. Then you got to tell this painter what to paint. The stuff is calculated by the code model part and made available to the painter through the property bag on the text editor or the document.
For example, in the painter you got an ITextBuffer for the current editor, then turn it into IVsTextBuffer via IVsEditorAdaptersFactoryService::GetBufferAdapter, then wrap it with the JetBrains.VsIntegration.Interop.Shim.TextManager.Documents.IVsTextBuffer accessor type, and it has the JetDocument property. This gives access to the code model's IDocument for the current editor from any editor's VS MEF component. There aren't any much other code model entities exposed into MEF though, so far every R# feature adds whatever it needs for itself in a similar way, by publishing on the text buffer bag.
For the very minimum, this JetDocument might suffice, if your data is fast to calculate and not too large. You can calculate it in a daemon stage and put into the IDocument's user-data-holder, and it will be available to the painter right away via the chain described above. The only issue is making the painter invalidate.
What I'm trying to accomplish, is draw information after end } symbols of code blocks.
The text was updated successfully, but these errors were encountered: