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
 better 'extract method'
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

podfish
Starting Member

1 Posts

Posted - Sep 29 2006 :  11:52:10 AM  Show Profile  Reply with Quote
this seems to always return VOID. It would be nice to have the dialog (where you enter a name for your method) also have a combo-box that lets you select a variable (or even better, any lvalue) from your code that would become the return value and establish the return-type of the method.

feline
Whole Tomato Software

United Kingdom
19023 Posts

Posted - Sep 30 2006 :  11:41:16 AM  Show Profile  Reply with Quote
i have seen VA generate a return type in my code. not all of the time, certainly, but it does happen.

this is a reasonable idea, but it will run into problems if the extracted code has no need to return a value. what happens if the extracted code needs to modify two variables, so they are both passed in as references?

plus it introduces an extra dialog. the design principle behind VA's refactoring is to use a set of very "small" tools, and then let the user chain them together however they want.

in this case i would suggest using extract method, and then using Change Signature afterwards to add the return type.

zen is the art of being at one with the two'ness
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