Change Int32 to int pattern
I am refactoring some legacy code and the previous developer used Int32 rather than int for variable assignments. How would I create a pattern to change "Int32 myVar" to "int myVar".
Thanks
Please sign in to leave a comment.
Hello Brian
You can use a 'Int32 $v$ = $expr$;' -> 'int $v$ = $expr$;' pattern where 'v' is an identifier placeholder and 'expr' is an expression placeholder. Let me know if this helps. Thank you!
Andrey Serebryansky
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
That works well when the declaration is in tge method but what about if it's an argurment to a method or a constructor?
Can you not just search and replace "Int32" to "int"?
I could, but then DataType.Int32 will get replaced or Convert.ToInt32 will get replaced. The point is to leverage R# to do this for me.