New reafctoring idea: move method/field up/down

I move methods and fields up and down in class declarations in numerous occasions. I think it could be very comfortable if such a thing was added to IDEA's refactoring toolkit ..

For example, before:


After:

5 comments

Try the Rearranger plugin. The Live Rearranger function would do what you
want.

"Evgeny Goldin" <no_mail@jetbrains.com> wrote in message
news:22013421.1078836675776.JavaMail.itn@is.intellij.net...

I move methods and fields up and down in class declarations in numerous

occasions. I think it could be very comfortable if such a thing was added to
IDEA's refactoring toolkit ..
>

For example, before:

>

 class A {
>     private void f1 () { .. }
>     private void f2 () { .. }
> }
> ]]>

>

After:

>

 class A {
>     private void f2 () { .. }
>     private void f1 () { .. }
> }
> ]]>

>


0

A good idea, I would such a feature from time to time. I would also use a related feature that would rearrange getters and setters to appear in the same order than the order of the fields.

Best regards,
Lars Ugleberg

0

There is another plugin named MoveElement that maps alt-pageup/pagedown to move an entire function or other class element. i used it very often before i used rearranger.

0

Thank you, folks, I'll try them.

0

Please sign in to leave a comment.