Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to know that autocompletion was automatically triggered, and stop it under some condition?
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
Ary Borenszweig is currently offline Ary BorenszweigFriend
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
Dani Megert is currently offline Dani MegertFriend
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
Previous Topic:HTML2TextReader class
Next Topic:Re: Command Dropdown in Toolbar
Goto Forum:
  


Current Time: Wed Jul 03 12:16:49 GMT 2024

Powered by FUDForum. Page generated in 0.03099 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top