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
 Extract Method improvment
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

TomJons
Senior Member

25 Posts

Posted - Nov 05 2018 :  10:36:28 AM  Show Profile  Reply with Quote
Hi,

Consider adding some features in Extract Method context:
- now I can only manipulate on method name and its destination (in class, outside,... )

1)I can't change shown method signature (types, names of parameters, nothing)
2)I can't see full extracted method body - maybe VA Team can provide another window below of "preview of method signature" called "preview of method body" - of course editable?


Why it will be useful?
- user can see what it will generate
- user can replace unrecognized types with valid types (example: value xxx is used in extracted area, but it was declared as auto, in extract method it is visible as type _Ty instead of valid type name)
- user can adjust code before extracting

Kind regards,
Tom

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Nov 05 2018 :  2:39:25 PM  Show Profile  Reply with Quote
We are considering adding the ability to edit the signature of the code, when doing an extract method:

case=3462

For the code that is going to be extracted, you know what this code is because you had to manually select it before triggering Extract Method. What sort of adjustments are you thinking of making before the code is extracted?

For the auto variable not having a known / correct type, do you have a situation where you can trigger this on demand? If VA can work out the type of the auto variable then the correct type should be used when VA extracts the code. It sounds like VA is not able to work out the type of the auto variable in your code, and I am wondering why.

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

TomJons
Senior Member

25 Posts

Posted - Nov 06 2018 :  03:24:55 AM  Show Profile  Reply with Quote
Unfortunately I can not reproduce this behavior on the small piece of code.

For the code preview I think it will be useful to see how it will look like. User can check if everything is on place.

Of course user can check it after extracting but it requires jumping on code.

Thx for your answer

Edited by - TomJons on Nov 06 2018 03:28:36 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Nov 06 2018 :  07:36:42 AM  Show Profile  Reply with Quote
We are considering adding a preview of the extracted code to the extract method dialog:

case=78447

For auto variables having an unknown type, if or when you next run into this problem in your main solution, can you please try placing the caret into the auto variable where it is being used, and then look at VA's Context and Navigation fields, which are normally shown at the top of the editor window, and are where the alt-m list appears from. VA should be showing the type of the variable here, which it has worked out.

Can you also try pressing Alt-Shift-G for the Goto Related menu, on the variable, and see if VA correctly understands this variable and its type? If VA is confused by the auto variable type, then this will show up in Extract Method, but this should be a simpler method of checking if VA understands the type of the auto variable or not.

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