Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tell Eclipse to auto-complete only method name?

Let's say I'm editing a line...

obj.fooBar(x, y, z);

I want to change the method name to fooSomethingElse, but keep most of the arguments. If I delete all or part of the name, and then use content assist, it completes the method name, but starts a new arg list...

obj.fooSomethingElse(arg1, arg2)(x, y, z)
                     ^---- this arg is highlighted for editing

I often have to delete "(arg1, arg2)". I can turn off "fill method arguments" in preferences and then I only have to delete "()", but it's still annoying. Is there another command to complete only the method name. Ideally it would just be a separate command and key combo from the general purpose content-assist, so I can invoke either one as needed.

like image 378
Rob N Avatar asked Jul 09 '12 15:07

Rob N


People also ask

How do I turn off autocomplete in eclipse?

Open menu Window, then Preferences. Follow path Java -> Editor -> Content assist. Now mess around with the settings to find your ideal setup. I believe what you'll want is to deactivate Insert single proposals automatically.

Does Eclipse have IntelliSense?

Microsoft Visual Studio has a famous feature called IntelliSense. Eclipse has a similar built in feature called "Code Assist" which I find very useful. Code Assist is triggered automatically in a number of situations (for example, typing the "." after a variable name or class name).


1 Answers

Essentially you are looking for a way to toggle between inserting and replacing via content assist. The default behavior is to insert. You can toggle this behavior while inside the content assist selection dialog by pressing and holding the Ctrl key while selecting the completion.
More inforation - http://blog.deepakazad.com/2012/06/jdt-tip-toggle-between-inserting-and.html

like image 194
Deepak Azad Avatar answered Oct 07 '22 19:10

Deepak Azad