Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | AkMor |
Is there a way to change all snake cases to camel cases for variables and node names in the whole project?
We initially didn’t decide on conventions, and the naming conventions are starting to mix.
I am not familiar with what a snake and camel case is, but if you have script open in the Editor, you do a Find/Replace for all scripts in the document by doing:
- Click “Search”
- Click “Find in Files…” in the drop down menu
- Enter your search string in the ‘Find’ field
- Select “Replace…”
- and then enter your replacement text to replace all occurrences
Doing the above approach blindly is dangerous, since you might introduce undetected syntax issues (or worse, logic error that don’t make a compilation error) in your scripts. So I suggest you review the preview pane at the bottom before replacing everything (it will show you all text instances that match your query that will be replaced)
godot_dev_ | 2022-08-05 19:52
Thank you, this is useful up to a couple hundred variables since I have to check each variable if it is safe to change, but it becomes unfeasible if there are thousands or even tens of thousands of variables. I wish there were a option in the godot UI to change the cases, or a script or vim-macro that does it automatically.
AkMor | 2022-08-06 09:50