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
 Refactor->Modify declaration (of variable)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Mordachai
Tomato Guru

USA
224 Posts

Posted - Feb 12 2013 :  12:30:44 PM  Show Profile  Reply with Quote
As we have the wonderful "Refactor->Change Signature", it would be sweet to have the same thing for variables.

mouse over one, right click, choose Refactor->Change Signature (or another command, if that is somehow confusing), and then be given a dialog in which the current type+name is specified. Change the type and or name, and the refactoring executes, with a VA Find References Results updated to show everything that referred to the now modified variable.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 12 2013 :  1:53:39 PM  Show Profile  Reply with Quote
You can use the Rename command on variables to change their names (after or before you change the type in the editor). When you change the type, the references cannot be automatically updated, so a refactoring for this wouldn't give any extra. Or do I miss something?
Go to Top of Page

Mordachai
Tomato Guru

USA
224 Posts

Posted - Feb 12 2013 :  2:05:55 PM  Show Profile  Reply with Quote
class Foo {
Bar * pBar
};

refactor "Bar * pBar" -> "std::shared_ptr<Bar> pBar"

As it is - it's pretty trivial to just "go to" the declaration of pBar, then modify the class definition manually. Just seemed like "if I can do exactly that for a function signature, why not for a variable declaration?"

This is pure icing - just seemed like a nice feature for essentially close to zero effort (of course, it may be much more than zero effort - I don't know how similar the code could be for variables as compared to functions).
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 13 2013 :  6:43:49 PM  Show Profile  Reply with Quote
I have put in a feature request for this to see what to developers make of it.

case=72388
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