Steve Benz

I'm trying to sort out how to implement auto-complete from within a custom editor. That is, my language's editor is based on a highly customized RichText editor, not the standard text editor. I'm afraid I'm quite a ways away from figuring this out myself.

What I've read so far suggests I need to implement IVsCompletionSet and pass that into IVsTextView.UpdateCompletionStatus. The trouble is, as an editor implementor, I implement IVsTextView, and thus I'd need to implement that.

I suspect that what I really need to do is create a language service object and have IVsTextView pass the job on to an IVsIntellisenseProvider.UpdateCompletionStatus. Unfortunately, that'd just move the problem down the road, as I don't see how I could implement that either.

Of course, when I say "I don't know how to implement", I mean I don't know how to implement it short of creating my own popup listbox and doing all the other heavy-duty windows coding to make that happen. I'm hoping that's not necessary.

Any pointers you could give me would be greatly appreciated. As I said, right now I'm a long ways away from knowing how to do this, so even just pointing me at the interfaces I'm going to need to implement and how they link together would be a great help.



Re: Visual Studio Extensibility Showing a Completion window from a custom editor

Steve Benz

Further reading (IntelliSense Hosting) reveals:

The IvsIntellisenseCompletor interface is a co-creatable version of the standard completion window used by the Visual Studio shell. Any IVsIntellisenseHost interface can quickly implement IntelliSense by using this completor interface.

So, from this, it very much looks like what I need to do is create me one of these "Completor" guys and somehow call it from my implementation of IVsTextView.UpdateCompletionStatus.

Unfortunately, the documentation for IVsIntellisenseCompletor is quite sparse (even by the meager standards of the rest of the SDK) and googling, Krugling and Kodering it does no good either.

Could I get a few pointers on whether I'm on the right track at all, and, if so, how to go about creating & calling the completor





Re: Visual Studio Extensibility Showing a Completion window from a custom editor

Dmitry Pavlov

Hi Steve,

You might know that there is an MPF (Managed Package Framework) including all needed base classes for custom language service and custom project type. Those base classes are managed wrappers for COM interfaces, and they contain default logic for most of features.

Have a look at C:\Program Files\Visual Studio 2005 SDK\2007.02\VisualStudioIntegration\Common\Source\CSharp\LanguageService\Source.cs (there are several MPF classes inside including Completor).

This folder (C:\Program Files\Visual Studio 2005 SDK\2007.02\VisualStudioIntegration\Common\Source\CSharp\Babel) contains also sources that can be intersting for learning.

Hope that helps.






Re: Visual Studio Extensibility Showing a Completion window from a custom editor

Dmitry Pavlov

One more good pointer to learn the building custom language service can be found here: C:\Program Files\Visual Studio 2005 SDK\2007.02\VisualStudioIntegration\Common\Source\CSharp\LanguageService\Docs\Overview.doc