How to know that autocompletion was automatically triggered, and stop it under some condition? [message #332143] |
Tue, 07 October 2008 01:06 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Ary Borenszweig![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=ary%40esperanto.org.ar) Messages: 8 Registered: July 2009 |
Junior Member |
|
|
Hi,
In an IDE I'm writing, "." triggers autocompletion. However, I would not
like it to trigger if it follows another dot. The IDE is for the D
programming language, and there you can slice arrays like this:
array[from .. to]
The thing is, when the user types the second ".", autocompletion would
be triggered suggesting local variables possibilities. However, in this
particular case it turns out to be annoying because maybe a number is
going to be written, or a space will be wanted after the second dot.
So I want to ignore that automatic autocompletion. However, if the user
presses ctrl+space at that specific location, I'd like to show her the
proposals as usual.
Is there a way to do this?
Thanks,
Ary
|
|
|
Re: How to know that autocompletion was automatically triggered, and stop it under some condition? [message #332147 is a reply to message #332143] |
Tue, 07 October 2008 07:09 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Dani Megert![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=Daniel_Megert%40ch.ibm.com) Messages: 3802 Registered: July 2009 |
Senior Member |
|
|
Ary Borenszweig wrote:
> Hi,
>
> In an IDE I'm writing, "." triggers autocompletion. However, I would
> not like it to trigger if it follows another dot. The IDE is for the D
> programming language, and there you can slice arrays like this:
>
> array[from .. to]
>
> The thing is, when the user types the second ".", autocompletion would
> be triggered suggesting local variables possibilities. However, in
> this particular case it turns out to be annoying because maybe a
> number is going to be written, or a space will be wanted after the
> second dot.
>
> So I want to ignore that automatic autocompletion. However, if the
> user presses ctrl+space at that specific location, I'd like to show
> her the proposals as usual.
>
> Is there a way to do this?
Yes, there is if you can use 3.4 or newer: add an ICompletionListener to
the ContentAssistant and then use ContentAssistEvent.isAutoActivated.
Dani
>
> Thanks,
> Ary
|
|
|
Powered by
FUDForum. Page generated in 0.03053 seconds