Inline Method as opposed to Extract Method

Hi,

Don't know if this is already in the Resharper EAP, but I'd like to have
a new refactoring option, 'Inline Method' as opposed to 'Extract
Method', similar to the 'Inline Variable' option.

Thanks to the Resharper Extract Method option (which works really
excellent), I end up with a lot of methods, and would like to be able to
play with combining different methods and return types in a different way.

For example, I refactored a part to this method:


now what I would prefer, is to inline the method again, skip the
headerPlaceHolder parameter, and have it return the new toolbar instead:


It could be easily done using Extract Method, if I could Inline the
method again...

Thanks!

- Wiebe Tijsma

p.s. Already posted this message in the Tracker Requests as well, sorry
if double posting like this isn't wanted, thought might post it in the
community as well to have ideas on this:
http://www.intellij.net/tracker/resharper/viewSCR?publicId=12258

7 comments
Comment actions Permalink

Check the resharper tracker, if it's not there already, submit a request...

"Wiebe Tijsma" <wiebeREMOVE@CAPITALStijsma.com> wrote in message
news:dknjlv$jmh$1@is.intellij.net...

Hi,

>

Don't know if this is already in the Resharper EAP, but I'd like to have a
new refactoring option, 'Inline Method' as opposed to 'Extract Method',
similar to the 'Inline Variable' option.

>

Thanks to the Resharper Extract Method option (which works really
excellent), I end up with a lot of methods, and would like to be able to
play with combining different methods and return types in a different way.

>

For example, I refactored a part to this method:

>

 ..
> AddToolbar(headerPlaceHolder);
> ...
>
> private void AddToolbar(PlaceHolder headerPlaceHolder)
> {
> toolbar = (ToolbarControl) 
> LoadControl("~/WebControls/ToolbarControl.ascx");
> headerPlaceHolder.Controls.Add(toolbar);
> }
> ]]>

>

now what I would prefer, is to inline the method again, skip the
headerPlaceHolder parameter, and have it return the new toolbar instead:

>

 ...
> this.toolbar = AddToolbar();
> headerPlaceHolder.Controls.Add(this.toolbar);
> ...
>
> private ToolbarControl AddToolbar()
> {
> (ToolbarControl) LoadControl("~/WebControls/ToolbarControl.ascx");
> }
> ]]>

>

It could be easily done using Extract Method, if I could Inline the method
again...

>

Thanks!

>

- Wiebe Tijsma

>

p.s. Already posted this message in the Tracker Requests as well, sorry if
double posting like this isn't wanted, thought might post it in the
community as well to have ideas on this:
http://www.intellij.net/tracker/resharper/viewSCR?publicId=12258



0
Comment actions Permalink

I requested this same thing a while back (but I never put it into tracker).

"Wiebe Tijsma" <wiebeREMOVE@CAPITALStijsma.com> wrote in message
news:dknjlv$jmh$1@is.intellij.net...

Hi,

>

Don't know if this is already in the Resharper EAP, but I'd like to have a
new refactoring option, 'Inline Method' as opposed to 'Extract Method',
similar to the 'Inline Variable' option.

>

Thanks to the Resharper Extract Method option (which works really
excellent), I end up with a lot of methods, and would like to be able to
play with combining different methods and return types in a different way.

>

For example, I refactored a part to this method:

>

 ..
> AddToolbar(headerPlaceHolder);
> ...
>
> private void AddToolbar(PlaceHolder headerPlaceHolder)
> {
> toolbar = (ToolbarControl) 
> LoadControl("~/WebControls/ToolbarControl.ascx");
> headerPlaceHolder.Controls.Add(toolbar);
> }
> ]]>

>

now what I would prefer, is to inline the method again, skip the
headerPlaceHolder parameter, and have it return the new toolbar instead:

>

 ...
> this.toolbar = AddToolbar();
> headerPlaceHolder.Controls.Add(this.toolbar);
> ...
>
> private ToolbarControl AddToolbar()
> {
> (ToolbarControl) LoadControl("~/WebControls/ToolbarControl.ascx");
> }
> ]]>

>

It could be easily done using Extract Method, if I could Inline the method
again...

>

Thanks!

>

- Wiebe Tijsma

>

p.s. Already posted this message in the Tracker Requests as well, sorry if
double posting like this isn't wanted, thought might post it in the
community as well to have ideas on this:
http://www.intellij.net/tracker/resharper/viewSCR?publicId=12258



0
Comment actions Permalink

Herewith lies the reason to actually put stuff in the tracker...

"Paul Bradshaw" <pbradshaw@advsol.com> wrote in message
news:dknu1p$bjp$1@is.intellij.net...
>I requested this same thing a while back (but I never put it into tracker).
>

"Wiebe Tijsma" <wiebeREMOVE@CAPITALStijsma.com> wrote in message
news:dknjlv$jmh$1@is.intellij.net...

>> Hi,
>>
>> Don't know if this is already in the Resharper EAP, but I'd like to have
>> a new refactoring option, 'Inline Method' as opposed to 'Extract Method',
>> similar to the 'Inline Variable' option.
>>
>> Thanks to the Resharper Extract Method option (which works really
>> excellent), I end up with a lot of methods, and would like to be able to
>> play with combining different methods and return types in a different
>> way.
>>
>> For example, I refactored a part to this method:
>>
>>

> ..
>> AddToolbar(headerPlaceHolder);
>> ...
>>
>> private void AddToolbar(PlaceHolder headerPlaceHolder)
>> {
>> toolbar = (ToolbarControl) 
>> LoadControl("~/WebControls/ToolbarControl.ascx");
>> headerPlaceHolder.Controls.Add(toolbar);
>> }
>> ]]>

>>
>> now what I would prefer, is to inline the method again, skip the
>> headerPlaceHolder parameter, and have it return the new toolbar instead:
>>
>>

> ...
>> this.toolbar = AddToolbar();
>> headerPlaceHolder.Controls.Add(this.toolbar);
>> ...
>>
>> private ToolbarControl AddToolbar()
>> {
>> (ToolbarControl) LoadControl("~/WebControls/ToolbarControl.ascx");
>> }
>> ]]>

>>
>> It could be easily done using Extract Method, if I could Inline the
>> method again...
>>
>> Thanks!
>>
>> - Wiebe Tijsma
>>
>> p.s. Already posted this message in the Tracker Requests as well, sorry
>> if double posting like this isn't wanted, thought might post it in the
>> community as well to have ideas on this:
>> http://www.intellij.net/tracker/resharper/viewSCR?publicId=12258
>



0
Comment actions Permalink

This was in the project plan until today, so I guess they aren't going to do it for V2.

Jim

0
Comment actions Permalink

Hello Jim,

Inline Method will appear in 2.*, but not in 2.0.

This was in the project plan until today, so I guess they aren't going
to do it for V2.

Jim

Thanks,
Andrey Simanovsky


0
Comment actions Permalink

Ouch...

"Andrey Simanovsky (JetBrains)" <ands@intellij.com> wrote in message
news:c8a8a15dd4da8c7b38030ece506@news.intellij.net...

Hello Jim,

>

Inline Method will appear in 2.*, but not in 2.0.

>
>> This was in the project plan until today, so I guess they aren't going
>> to do it for V2.
>>
>> Jim
>>

Thanks,
Andrey Simanovsky

>



0
Comment actions Permalink

:(

"Andrey Simanovsky (JetBrains)" <ands@intellij.com> wrote in message
news:c8a8a15dd4da8c7b38030ece506@news.intellij.net...

Hello Jim,

>

Inline Method will appear in 2.*, but not in 2.0.

>
>> This was in the project plan until today, so I guess they aren't going
>> to do it for V2.
>>
>> Jim
>>

Thanks,
Andrey Simanovsky

>



0

Please sign in to leave a comment.