Return type -- auto insertion?

If I key in something like this:

objectA.getOtherObject();

Is there a way to have IntelliJ automatically insert the return type of
getOtherObject() for me? So that the result would like like:

OtherObject ]]> = objectA.getOtherObject();


Thanks,

Ted

3 comments
Comment actions Permalink

Hello Ted,

I usually invoke an introduce variable refactoring when I want to obtain
the result you mention. If you install the SmartIntroduce plugin as well,
achieving the desired result will be even simpler: you won't have to select
anything on the line before invoking the refactoring, making the whole flow
really painless.

HTH,
Andrei

TH> If I key in something like this:
TH>
TH> objectA.getOtherObject();
TH>
TH> Is there a way to have IntelliJ automatically insert the return type
TH> of getOtherObject() for me? So that the result would like like:
TH>
TH> OtherObject = objectA.getOtherObject(); TH> TH> Thanks, TH> TH> Ted TH>]]>


0
Comment actions Permalink

Note that SmartIntroduce is a nice plugin, but this already works in plain Idea (as long as the expression is all that you currently have written on the editor line).
Simply hit ctrl-alt-v.

0
Comment actions Permalink

Good find stephen, didn't know this one!

0

Please sign in to leave a comment.