Search code examples
c#vb.netroslynvsta

Built-in C#/VB.Net editor with intellisense - Roslyn, VSTA, or something else?


I need to provide scripting capabilities within my application, allowing customers to extend its functionality using our object model. I was hoping to offer some kind of integrated C#/VB.Net editor with intellisense, but after looking at products like AvalonEdit and ScintillaNet, they don't appear to provide true code-completion, just an API where you can provide your own list of items to appear in the popup autocomplete list.

I was therefore wondering if Roslyn provided any such features? From the tutorials and examples I've come across, it appears that Roslyn is really just a compiler service.

As a last resort the customers could use something like VS Express but an integrated editor is obviously a bit nicer.

(I also came across Visual Studio Tools for Applications, which sounded promising; however the online resources are several years old, and documentation/tutorials are non-existent, so I've drawn a blank with this one).


Solution

  • I'm ceretainly not an expert in this area. But since you haven't received any other replies, I'll take a shot.

    I think the short answer is "yes".

    Looking at the code in AvalonEdit and SharpDevelop, it appears that code completion is one of the most difficult parts. Essentially, you have to write a compiler (or a parser, anyway) to figure out what items should be on the completion list. It appears that Roslyn provides tools for constructing the completion list. In older versions, these tools were tied to the VS editor, but I have seen statements saying that they are independent in the latest release. If so, these tools will be very useful in implementing code completion.

    I haven't really looked into the details at all, but I intend to, since I have some of the same goals as you, and Roslyn looks like it will be helpful (based on what I know so far, which is not very much).