[MonoDevelop] AutoCompleteUniqueMatch & custom behavior when a user selects a specific code completion item

Lluis Sanchez Gual lluis at novell.com
Thu Jun 4 12:02:17 EDT 2009

El dj 04 de 06 de 2009 a les 16:17 +0200, en/na Carlo Kok va escriure:
> Hi everyone,
> I'm implementing Codecompletion support for our custom language inside 
> MonoDevelop and in some cases simple text insertion doesn't really 
> suffice for my use, although for most items it will. We have some items 
> in our list that have to insert a method before/after the current 
> method, and some other items that add fields or properties. How can I 
> accomplish this in mono, that it executes some custom behavior for 
> completion items.

Implement the interface IActionCompletionData instead of
ICompletionData. The InsertCompletionText method is called when the text
needs to be inserted. You can insert whatever you want there.

> My second question is, what does AutoCompleteUniqueMatch do ?

When set to True and the completion data list only has one element than
fits the current context, then the completion window will not be shown
and instead the single matching element will be automatically inserted.
This is used for example in this case:


being the cursor '|', if you press ctrl+space then
AutoCompleteUniqueMatch will be set to true, so in this case since there
is only one possible match (WriteLine), the completion window won't be
shown and WriteLine will automatically be completed.


More information about the Monodevelop-list mailing list