Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 better 'extract method'

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
podfish Posted - Sep 29 2006 : 11:52:10 AM
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.
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Sep 30 2006 : 11:41:16 AM
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.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000