Renaming all variables of a model from camelCase to snake_case
Hi,
For some strange reason (something to do with postgres) I was tasked with renaming all our model properties from camel case to snake case. I found the String Manipulation Rider plugin that does that but unfortunately it only renames the property, it does not refactor the rest of the code accordingly.
My question is: is there a way to automate or semi-automate this process? Ideally I would select one property and it would be renamed from camel case to snake case throughout the entire solution like the standard Rename feature does.
Please sign in to leave a comment.
Hello Jose Simas,
There is a way to semi-automate this process. You can record a macro of this process and apply it to the properties you need. Macro will include renaming with String Manipulation combined with Rider's refactoring to achieve your goal.
I've recorded a sample macro that should help you with the renaming. The only input required from your side is to hit paste when prompted to rename the property and confirm the refactoring. Note that the caret should be placed right after the property name for this to work.
The macro looks like this:
Hi Kirill,
Many thanks! I did not know about macros and this is exactly what I need.
Hi Jose,
Glad it works for you, have a nice day!