Is there some sort of "Inline method" refactoring?


Hello all,

Look at the code below.

void Main() {
F1_ThinWrapper(); // F1_ThinWrapper will be replaced by F1
}

void F1_ThinWrapper() {
F1();
}

void F1() {}

== AFTER INLINING ==

void Main() {
F1();
}

void F1() {}

======

Lets say Main contains hudge amount of F1_ThinWrapper() calls. During some
refactoring I recognized that this method is redundant.

How can I "inline" F1_ThinWrapper method so that it is replaced by it's content

(F1_ThinWrapper calls are replaced by F1_ThinWrapper's body)?
Or is there another workaround?

Thanks,


1 comment
Comment actions Permalink

Hello tivadj,

Inline Method refactoring will (hopefuly) appear in ReSharper 4.

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


t> Hello all,
t>
t> Look at the code below.
t>
t> void Main() {
t> F1_ThinWrapper(); // F1_ThinWrapper will be replaced by F1
t> }
t> void F1_ThinWrapper() {
t> F1();
t> }
t> void F1() {}
t>
t> == AFTER INLINING ==
t>
t> void Main() {
t> F1();
t> }
t> void F1() {}
t>
t> ======
t>
t> Lets say Main contains hudge amount of F1_ThinWrapper() calls. During
t> some refactoring I recognized that this method is redundant.
t>
t> How can I "inline" F1_ThinWrapper method so that it is replaced by
t> it's content
t>
t> (F1_ThinWrapper calls are replaced by F1_ThinWrapper's body)? Or is
t> there another workaround?
t>
t> Thanks,
t>


0

Please sign in to leave a comment.