T O P I C R E V I E W |
Mordachai |
Posted - Feb 12 2013 : 12:30:44 PM 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. |
3 L A T E S T R E P L I E S (Newest First) |
accord |
Posted - Feb 13 2013 : 6:43:49 PM I have put in a feature request for this to see what to developers make of it.
case=72388 |
Mordachai |
Posted - Feb 12 2013 : 2:05:55 PM 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). |
accord |
Posted - Feb 12 2013 : 1:53:39 PM 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? |
|
|