Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Projecting from an IVsInvisibleEditor

$
0
0

I'm trying to break C# files apart into individual functions and embed each function within an editor pane of its own.

See:

My approach has been as follows:

1. Create an IVsInvisibleEditor for the C# file.

2. Create an IElisionBuffer from the IVsInvisibleEditor's buffer representing an individual function.

3. Get the WpfTextViewHost for the IElisionBuffer and embed it within a ContentControl.


While syntax highlighting, error squiggles and "Rename Method" functions work, I'm having difficulty getting other C# Language Services working. Namely, I cannot get Intellisense auto-completion to work with Visual Studio 2012 or Visual Studio 2013. (The screenshot above is taken with Visual Studio 2012 + Roslyn Language Services, which for some reason does work).

I've thrown an entire working project up on Github to demonstrate how I'm trying to accomplish this. The code I've described above can be found here: https://github.com/JoshVarty/NoDeveloperMargin/blob/master/NoDeveloperMargin/MyToolWindow.cs#L69

A Microsoft PFE Tomas Restrepo has been kind enough to work with me and try to remedy this issue. He's provided the following solution: https://gist.github.com/tomasr/88d86d087a2ee86af554#file-mytoolwindow-cs-L73

However, his solution throws an ArgumentOutOfRange Exception. I think there might be an issue with re-using the IVsTextBuffer docAdapter as he has. Internally, it seems like Visual Studio has problems with the length of one of the buffers.

I've been trying to accomplish this for a long time, but have yet to get in contact with anyone on the Visual Studizo Editor team. Even if you cannot answer the question, if you know someone who might be able to help me I'd love if you could point me in their direction.



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>