Rename Forwarding

I was instructed to make some significant changes to the outdated code base, which was not written using existing code style rules. The changes are vast enough that I do the cleanup and refactoring (there was quite a bit of dead code) before I start. One of the things that bothers me is that the fields follow the m_FieldName naming convention, whereas we now use _fieldName.

Is there a way using Resharper to automatically rename all fields in the project to follow the new convention? Are there other tools that can easily do this? It is not too difficult to remove the prefix "m" even with a simple search / replace, but I have not found an automated way to change the case of the starting letter.

+6
source share
2 answers

It is best to just find / replace <m_ with _ using Visual Studio (search / replace regular expressions).

< means the beginning of a word.

Edit: There seems to be no way using Find / Replace to change the shell of this first letter after underlining.

So, you will need to perform this operation 26 times in a row, for example:

 Replace <m_A by _a Replace <m_B by _b 

and then you are all set up. Fun too :-) But it only takes a few minutes.

+11
source

Now this is similar to Resharper (I have v10):

enter image description here

0
source

Source: https://habr.com/ru/post/905540/


All Articles