Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Code completion for just method name (Java editor)
Code completion for just method name (Java editor) [message #175332] Wed, 18 October 2006 22:03 Go to next message
Paul A. Rubin is currently offline Paul A. RubinFriend
Messages: 188
Registered: July 2009
Senior Member
Hi all,

In Eclipse 3.2 (Java editor), let's say I have a line

something = method(arg1, arg2);

and I want to change 'method' without changing the arguments. Is there
a slick way to do this using code completion? With my current settings,
if I highlight 'method', start typing the replacement name and hit
Ctrl-space to pick the replacement, it inserts a new set of parentheses
and dummy arguments in front of '(arg1, arg2)'. If I highlight the
entire call to 'method', it replaces the existing arguments with dummies.

If possible, I'd like to preserve the behavior that code completion with
no parentheses and arguments present inserts the parentheses and the
dummy arguments.

Sorry if this falls in the 'RTFM' category, but every time I wander into
the options screens my eyes start to water. :-)

/Paul
Re: Code completion for just method name (Java editor) [message #175394 is a reply to message #175332] Thu, 19 October 2006 07:38 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Paul Rubin wrote:

> Hi all,
>
> In Eclipse 3.2 (Java editor), let's say I have a line
>
> something = method(arg1, arg2);
>
> and I want to change 'method' without changing the arguments. Is
> there a slick way to do this using code completion? With my current
> settings, if I highlight 'method', start typing the replacement name
> and hit Ctrl-space to pick the replacement, it inserts a new set of
> parentheses and dummy arguments in front of '(arg1, arg2)'. If I
> highlight the entire call to 'method', it replaces the existing
> arguments with dummies.

Try to set Java > Editor > Content Assist > (°) Completion overwrites.
If you don't like that mode but only used it rarely then do this: in
your example use Ctrl+Space then hold down the 'Ctrl' key to toggle the
mode.

Dani

>
> If possible, I'd like to preserve the behavior that code completion
> with no parentheses and arguments present inserts the parentheses and
> the dummy arguments.
>
> Sorry if this falls in the 'RTFM' category, but every time I wander
> into the options screens my eyes start to water. :-)
>
> /Paul
Re: Code completion for just method name (Java editor) [message #175550 is a reply to message #175394] Thu, 19 October 2006 15:53 Go to previous message
Paul A. Rubin is currently offline Paul A. RubinFriend
Messages: 188
Registered: July 2009
Senior Member
Daniel Megert wrote:

>
> Try to set Java > Editor > Content Assist > (°) Completion overwrites.
> If you don't like that mode but only used it rarely then do this: in
> your example use Ctrl+Space then hold down the 'Ctrl' key to toggle the
> mode.
>

Much obliged!

/Paul
Previous Topic:Eclipse Product export wizard and script
Next Topic:Cannot find properties file
Goto Forum:
  


Current Time: Fri Apr 19 14:37:39 GMT 2024

Powered by FUDForum. Page generated in 0.03052 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top