Reputation:
My auto activation keys are set to a to z. Thus once I type str, it proposes StringBuilder
, which is what I want.
Then, I press Space to accept the suggestion, and type sb for the variable name. Eclipse shows Non-Type proposals "sBuilder". Since I have decided the variable name to be sb
, the Non-Type proposals are useless.
As the annoying proposal shows, I cannot continue to type =, because Eclipse will change my variable name from sb
to sBuilder
. So I have to press Esc, then =.
Every time I define variables, Eclipse always gives me Non-Type proposals, which costs one Esc to reject. How to disable Non-Type proposals in Eclipse??
Upvotes: 4
Views: 3865
Reputation: 357
This question may provide what you want a solution in another form: Stop spacebar keypress from triggering autocomplete in Eclipse
The answers here provides a means for the autocompletion to not interfere with the typing eliminating the problem. I personally have my eclipse set up to trigger autocomplete on every character typed but then have it say (Via source editing) to only have the enter key accept. This allows you for only accepting autocompletion when you want to.
Upvotes: 0
Reputation: 22070
The easiest way to get what you want is to change your workflow a tiny bit: Type "new Str" instead of "Str" only, let Eclipse auto complete this to "new StringBuilder()", hit Ctrl2,L to automatically create an assignment to a local variable in front of the constructor and just type the name as you want it.
That's less keystrokes and less choices presented by code completion.
Upvotes: 1
Reputation: 18569
Try this:
Window - Preferences
.Java - Editor - Content Assists - Advanced
.Java Proposals
should be checked by default. Java Proposals
consists of both Non-type
and Type proposals
.Non Type Proposal
, uncheck the Java Proposals
and Java Non-Type Proposals
, then check the Java Type Proposals
.Upvotes: 2