Prevent Content Assist from executing, if only one hit is found [message #250945] |
Fri, 25 January 2008 12:05  |
Eclipse User |
|
|
|
Hi,
if content assist only finds one option, it (generally) executes this
option, without displaying it first (e.g. I enter syserr <ctrl+space> and
it directly expands to System.err.println("");). I know that I can disable
this in the preferences.
However, what I would like to have is a possibility to prevent certain
categories of content assists from being executed if there's only one
option. Can I achieve this somehow (aside from returning two hits where
there's only one)?
Thanks,
Philipp
|
|
|
|
Re: Prevent Content Assist from executing, if only one hit is found [message #251055 is a reply to message #250966] |
Tue, 29 January 2008 03:04   |
Eclipse User |
|
|
|
>> if content assist only finds one option, it (generally) executes this
>> option, without displaying it first (e.g. I enter syserr <ctrl+space>
>> and it directly expands to System.err.println("");). I know that I can
>> disable this in the preferences.
>> However, what I would like to have is a possibility to prevent certain
>> categories of content assists from being executed
> What categories are you talking about? Templates vs. Java?
Yeah, in that line. I have defined my own category (call it
"myplugin.category" for example) and it nicely displays after the "java"
and "template" proposals. However, if only _one_ content assist proposal
is found, no matter what category it is in, it is automatically executed
-- unless I deactivate that feature altogether in the preferences.
What I'd like to have is that if only one proposal is found, and it is of
the category "java", it should be executed; if however, only one proposal
is found and it's of the category "myplugin.category", I'd like the user
to conciously decide to execute the proposal.
Is that possible?
Thanks.
|
|
|
Re: Prevent Content Assist from executing, if only one hit is found [message #251058 is a reply to message #251055] |
Tue, 29 January 2008 03:10   |
Eclipse User |
|
|
|
Philipp Bouillon wrote:
>>> if content assist only finds one option, it (generally) executes
>>> this option, without displaying it first (e.g. I enter syserr
>>> <ctrl+space> and it directly expands to System.err.println("");). I
>>> know that I can disable this in the preferences.
>>> However, what I would like to have is a possibility to prevent
>>> certain categories of content assists from being executed
>>
>
>> What categories are you talking about? Templates vs. Java?
>
>
> Yeah, in that line. I have defined my own category (call it
> "myplugin.category" for example) and it nicely displays after the
> "java" and "template" proposals. However, if only _one_ content assist
> proposal is found, no matter what category it is in, it is
> automatically executed -- unless I deactivate that feature altogether
> in the preferences.
>
> What I'd like to have is that if only one proposal is found, and it is
> of the category "java", it should be executed; if however, only one
> proposal is found and it's of the category "myplugin.category", I'd
> like the user to conciously decide to execute the proposal.
>
> Is that possible?
Yes: let your proposal implement
org.eclipse.jface.text.contentassist.ICompletionProposalExte nsion4.isAutoInsertable()
and return 'false'.
Dani
> Thanks.
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04208 seconds