c# - Add custom editor windows to Visual Studio window panes -
my problem
i'm trying build extension visual studio allows code edited on per-function basis, rather per-file basis. i'm attempting display code in similar fashion microsoft debugger canvas.
i'm wondering how host multiple visual studio editors within single window (i believe windows implementing ivswindowframe). functionality i'm after can seen below:
each editor window retains typical functionality , interacts third-party extensions expected. (for example, vsvim functions correctly within these windows).
what i've tried
i've spent 2 weeks researching , trying stuff , i'm having lot of trouble figuring out services, interfaces , classes i'm going using.
reading through msdn
first off, of documentation discusses how edit single editor window , add adornments, tags, margins etc. doesn't discuss possibility of spawning multiple editors within window pane.
i've looked through documentation on vast number of interfaces of interest me including ivstextbuffer
, ivstextview
, ivsinvisibleeditor
. unfortunately can't of these interfaces play nicely together.
on top this, excellent msdn extremely lacking in area. many of interfaces contain list of members without basic remark on intended use , functional. (icomponentmodel, example).
many of interfaces make reference set of editor samples code cannot read or downloaded on msdn. apparently shipped visual studio 2005, don't have version of visual studio, nor can find it.
interacting ivsuishell
i can access windowframes open using ivsuishell.getdocumentwindowenum();
see there ivsuishell.createdocumentwindow() method, i'm unfamiliar parameters accepts, or if correct path go down.
what need do
- programatically create dockable window pane
- programatically add editors window pane. (and ensure they're correctly registered within visual studio, running document table, etc.)
edit:
i'm sorry, should have expanded on steps. when said needed register running document table , visual studio, it's because want edit original document in custom editor. below short example of functionality available in debugger canvas i'm trying recreate:
http://i.imgur.com/aym8a5e.gif (i can't embed .gif)
alternatively:
if knows can find editor samples included visual studio 2005 such basic editor sample i'm sure figure stuff out. msdn documentation has no code samples regarding these interfaces, has made job extremely difficult.
the git source control provider open source extension includes tool pane embeds standard editor control within custom wpf tool window. use code reference visual studio 2010+ extension wanted host editor window in custom location.
pendingchangesview.xaml
includescontentcontrol
nameddiffeditor
, content of editor.pendingchangesview.xaml.cs
includes methodshowfile
, calls method create editor control , assigns result content ofdiffeditor
.toolwindowwitheditor.cs
includes methodsetdisplayedfile
returnstuple<control, ivstextview>
interface, provides accesscontrol
can addedcontentcontrol
ivstextview
text view. the heavy lifting in method.
note setdisplayedfile
method includes several lines following form:
textviewhost.textview.options.setoptionvalue({name}, {value});
these lines perform key functionality git source control provider such removing margins , making window read only. there many options available, you'll want review documentation defaulttextviewoptions
, defaulttextviewhostoptions
apply ones appropriate particular extension.
Comments
Post a Comment