Eclipse autocomplete irritation
I seem to frequently trip over a particular "feature" of Eclipse's autocomplete behavior. Say that I'm programming in Java and start to code a method call like this:
for (int i = 0; i < n; ++i) {
thing.
When I type the .
, Eclipse pops up a list of candidate methods for thing
. Suppose I select method(int index)
. Eclipse inserts my choice:
for (int i = 0; i < n; ++i) {
thing.method(index)
It also highlights index
and pops up a list of variables I might want to use. The first item on the list is index
and the second one is i
. Not wanting to move 开发者_开发知识库my hands from the keyboard, I type i
.
The problem is, I then out of habit usually press enter
to complete the autocompletion sequence. Unfortunately, this causes Eclipse to select the first item on the suggestion list that starts with i
, which is index
. Argh! To avoid this, I need to either:
- remember to press
tab
instead ofenter
after typingi
; - select
i
from the suggestion list instead of typing it; - press
esc
(twice!) to get rid of the suggestion list before pressingenter
.
With all of these, I'm forced to interrupt my thinking about my code in order to think about how to use Eclipse.
I realize that this is a long-winded rant for a fairly niggling problem, but I do actually have a question. Are there any settings in Eclipse (short of turning off autocompletion, which is otherwise very helpful) to either (1) tell it to rank legal options above illegal ones in the suggestion list or (2) otherwise tell Eclipse that when I type an i
, that's what I want?
In the 'Java -> Editor -> Content Assist' preference page set 'Fill method arguments and show guessed arguments' to 'Insert best guessed arguments'
精彩评论