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
 Bulk Rename - using wildcards
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Reticulatas
New Member

3 Posts

Posted - Sep 13 2018 :  2:03:25 PM  Show Profile  Reply with Quote
I have this code:


bool something;
int foo;
someClass obj;


I do this:


struct State
{
  bool something;
  int foo;
  someClass obj;
};
State state;


I now want have to go do a VA rename for all uses of the members, renaming them like:
before: something
after: state.something

I have to do this for each field individually. It would be nice to have a bulk rename that could perform operations like this automatically.

When you rename, perhaps the wildcard operator could be used to signify where in the rename the original symbol is placed.

Edited by - Reticulatas on Sep 13 2018 2:03:57 PM

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 13 2018 :  3:22:17 PM  Show Profile  Reply with Quote
Thank you for the idea. I have put in a feature request for this:

case=119232

I imagine this to be a refactoring to move variables to class / struct via an object.
I also mentioned your approach.
My idea is to pick an object in scope, and VA would move the selected variables to its struct or class.

So you would begin with something like:

bool something;
int foo;
someClass obj;


struct State
{
};
State state;

in this case, but the command would be more general, applicable to classes and struct that already has members in them.

What do you think?
Go to Top of Page

Reticulatas
New Member

3 Posts

Posted - Sep 14 2018 :  1:08:54 PM  Show Profile  Reply with Quote
I agree, I realize having a general purpose utility for this would open a can of worms regarding how to handle bulk text manipulation. The specific case of "Encapsulate Fields" is more readily applicable.
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