[MonoDevelop] AutoCompleteUniqueMatch & custom behavior when a user selects a specific code completion item
Carlo Kok
ck at carlo-kok.com
Fri Jun 5 11:05:18 EDT 2009
On 4-6-2009 18:02, Lluis Sanchez Gual wrote:
> 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.
ah perfect, that's what I was looking for.
>
>>
>> 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:
>
> Console.WriteLi|
>
> 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.
>
Ah that's clear now,
Thanks.
--
Carlo Kok
RemObjects Software
The Infrastructure Company
http://www.remobjects.com
More information about the Monodevelop-list
mailing list