Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to determine the trigger for Content Assist!
How to determine the trigger for Content Assist! [message #325504] Wed, 20 February 2008 10:07 Go to next message
Eclipse UserFriend
Can anyone tell me if it is possible to determine what triggered a content
assist?
I have my completion processor and most things work fine but I have a
problem where I need
to obtain the char (or sequence of chars) that triggered the Content Assist.

Basically my problem is that in my editor the user enters '(' like the
Content Assist for
Java I want to display content assist - this works fine and when the user
enters a ')' I want to
terminate or not show any more proposals - I am implementing this by looking
for a ')' in the Document
and if I find one just return empty proposals.

BUT: If the user hits ctrl+space then I want to display the proposals - this
is where I am having my
problem! At the moment, nothing will happen if there is already a ')' in the
Document so I was hoping to look for
the trigger that invoked Content Assist and if it was Ctrl+Space then I
would go ahead and get proposals.

Does this make sense??
Re: How to determine the trigger for Content Assist! [message #325505 is a reply to message #325504] Wed, 20 February 2008 11:43 Go to previous messageGo to next message
Eclipse UserFriend
gdollard wrote:
> Can anyone tell me if it is possible to determine what triggered a content
> assist?
>
Since 3.4 the content assist event tells you whether auto-activation
happened or not. If yes, you could get the trigger char from the viewer.

Dani
> I have my completion processor and most things work fine but I have a
> problem where I need
> to obtain the char (or sequence of chars) that triggered the Content Assist.
>
> Basically my problem is that in my editor the user enters '(' like the
> Content Assist for
> Java I want to display content assist - this works fine and when the user
> enters a ')' I want to
> terminate or not show any more proposals - I am implementing this by looking
> for a ')' in the Document
> and if I find one just return empty proposals.
>
> BUT: If the user hits ctrl+space then I want to display the proposals - this
> is where I am having my
> problem! At the moment, nothing will happen if there is already a ')' in the
> Document so I was hoping to look for
> the trigger that invoked Content Assist and if it was Ctrl+Space then I
> would go ahead and get proposals.
>
> Does this make sense??
>
>
>
>
Re: How to determine the trigger for Content Assist! [message #325506 is a reply to message #325505] Wed, 20 February 2008 11:54 Go to previous message
Eclipse UserFriend
cool, thanks Daniel.

"Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
news:fphlce$jpv$1@build.eclipse.org...
> gdollard wrote:
>> Can anyone tell me if it is possible to determine what triggered a
>> content assist?
>>
> Since 3.4 the content assist event tells you whether auto-activation
> happened or not. If yes, you could get the trigger char from the viewer.
>
> Dani
>> I have my completion processor and most things work fine but I have a
>> problem where I need
>> to obtain the char (or sequence of chars) that triggered the Content
>> Assist.
>>
>> Basically my problem is that in my editor the user enters '(' like the
>> Content Assist for
>> Java I want to display content assist - this works fine and when the user
>> enters a ')' I want to
>> terminate or not show any more proposals - I am implementing this by
>> looking for a ')' in the Document
>> and if I find one just return empty proposals.
>>
>> BUT: If the user hits ctrl+space then I want to display the proposals -
>> this is where I am having my
>> problem! At the moment, nothing will happen if there is already a ')' in
>> the Document so I was hoping to look for
>> the trigger that invoked Content Assist and if it was Ctrl+Space then I
>> would go ahead and get proposals.
>>
>> Does this make sense??
>>
>>
>>
>>
Previous Topic:TableViewer refresh
Next Topic:How to create Eclipse Watchpoint breakpoints
Goto Forum:
  


Current Time: Thu May 08 03:59:22 EDT 2025

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

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

Back to the top