How to know that autocompletion was automatically triggered, and stop it under some condition? [message #332143] |
Mon, 06 October 2008 21:06  |
Eclipse User |
|
|
|
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 03:09  |
Eclipse User |
|
|
|
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.04464 seconds