Edi" />
开发者

What does "Insert common prefixes automatically" do in Eclipse?

开发者 https://www.devze.com 2023-02-06 23:37 出处:网络
I was looking for a way to improve autocompletion in Ecl开发者_如何转开发ipse and I found this preference setting \"insert common prefixes automatically\" in the preference window, section Java -> Edi

I was looking for a way to improve autocompletion in Ecl开发者_如何转开发ipse and I found this preference setting "insert common prefixes automatically" in the preference window, section Java -> Editor -> Content Assist.

I wonder what it does because I didn't feel any difference. The help says:

If enabled, code assist will automatically insert the common prefix of all possible completions similar to Unix shell expansion. This can be used repeatedly, even while the code assist window is being displayed.


It only applies in a (relatively) small number of cases.

Imagine you have an interface with methods

public interface Farm {
   public int getNumberOfDucks();
   public int getNumberOfChickens();
   public int getNumberOfGeese();
}

then if you have this option turned on and type

farm.getN<control-space>

it will autocomplete to

farm.getNumberOf

before it shows you the menu. Without it, it will show you the menu straight away, without filling anything in.

It only seems to work for members, and not for classes.

0

精彩评论

暂无评论...
验证码 换一张
取 消