Adding Items to Intellisense whilst using a standard Language

SyntaxEditor for WPF Forum

Posted 7 years ago by Marcus Gabriel
Version: 12.2.0570
Avatar

I'm having a problem with Syntax Editor whilst using it with the built in VB language. Whilst Intellisense works correctly with the standard VB variables etc. I want to insert some external variables. Is there an easy way to do this? Is there a way I can get the session, all the documentation just describes how to create a session for a new language.

Thanks.

Comments (3)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Marcus,

Yes, you can create a class that inherits VBCompletionProvider and override its OnSessionOpening method.  That will pass you the session about to be displayed by automated IntelliPrompt.  Then you can customize the items in it however you want, such as adding new items.

Then you'd want to "replace" the default completion provider server with your custom one.  Something like this:

language.RegisterService(Of VBCompletionProvider)(New MyCustomizedCompletionProvider())

That should do the trick.


Actipro Software Support

Posted 7 years ago by Marcus Gabriel
Avatar

Thanks very much, that worked a treat!

There is one slight issue though, when using an overidden OnSessionOpening method (even when not doing anything in the method), the order of the items is no longer alphabetic when displayed! Is this something that I need to apply, and if so is there an easy way?

Thanks.

Marcus.

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Marcus,

Sorry, I should have mentioned that.  The base method calls session.SortItems().  So you can call the same or just call the base method after you add your own items.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.