Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Refactoring: Reverse of Extract Method
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 27 2006 :  07:22:02 AM  Show Profile  Reply with Quote
I like the new refactoring function "Extract Method", but it sometimes happens to me that I need the reverse function. For example: I had a function that shrinked down to 4 lines of code after some refactoring. I called this function just from 2 locations in the code. So my idea was to remove the function and copy its code directly to the 2 locations. It would be cool if this function would be available from the refactoring menu. Of course, this should only be possible if the function to remove doesn't call itself

Regards,
Marcus.

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jun 27 2006 :  4:44:08 PM  Show Profile  Reply with Quote
i can think of times when working out if the function calls its self would be rather hard to determine. heavy use of overloaded functions plus default parameters is a good example

my gut instinct is to say "leave the function alone", since i have come to view small functions as good, but i understand why you are saying this. it would require the ability to remove the function, and its declaration.

i have just been sitting here, trying to work out it this presents any obvious problems or challenges that would make this very hard to do. so far though i have not come up with anything that sounds worse than extract method must have been, so i have put in a feature request

case=1493

zen is the art of being at one with the two'ness
Go to Top of Page

jpizzi
Tomato Guru

USA
642 Posts

Posted - Jun 27 2006 :  11:18:19 PM  Show Profile  Reply with Quote
Here is how you can do this without VA's support.

At the beginning of the line, type the string, "inline "

Of course, if you need want VA's help, you could always create an autotext entry

Joe Pizzi
Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 28 2006 :  02:13:43 AM  Show Profile  Reply with Quote
@feline: Thanks for putting in a feature request.
@joe:

Regards,
Marcus.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jun 28 2006 :  11:54:58 AM  Show Profile  Reply with Quote
FWIW: Refactoring is sometimes called "Inline Method."

http://www.refactoring.com/catalog/inlineMethod.html
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000