Can I use completion session triggers in my own language?

SyntaxEditor .NET Languages Add-on for WPF Forum

Posted 13 years ago by Craig - Varigence, Inc.
Version: 11.1.0544
Avatar
When using the C# language add-on's built-in intelliprompt, one thing we get is that a completion list is automatically triggered by specific key events, such as pressing a . character after an identifier.

Now, let's say I'm writing my own completion provider in my own syntax language. To trigger a completion session, the Actipro documentation suggests that I implement the syntax editor's DocumentTextChanged event and watch for specific characters being typed.

However, let's say I want to trigger a completion session using the same logic as the C# add-on. Is there any way I can leverage the C# add-on's logic for triggering completion sessions, instead of re-implementing this logic myself? Perhaps there's an attached behavior I can attach my syntax editor to, or some service I can register on my language?

Thanks,

-Craig

[Modified at 08/19/2011 01:49 PM]

Comments (3)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Craig,

If you have a CSharpCompletionProvider instance handy, it implements IEditorDocumentTextChangeEventSink so you can just call IEditorDocumentTextChangeEventSink.NotifyDocumentTextChanged on it when appropriate to kick in default logic.


Actipro Software Support

Posted 13 years ago by Craig - Varigence, Inc.
Avatar
But wouldn't this trigger a C# completion session? The scenario I'm picturing is that I use C# completion session triggers (Ctrl+Space, the . character, etc...) to invoke my completion provider's RequestSession method.
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes that would use the C# completion provider. Ctrl+Space will be handled automatically by SyntaxEditor if you have a completion provider on your language at all. Sorry we don't have anything else to give similar logic for the C# completion provider as far as handling "." keys, etc.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.