Add an auto-refactoring popup to prevent export property data loss for scripts #11898
FlooferLand
started this conversation in
Engine Core
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The problem
Currently, Godot deletes all data belonging to a script's export property if its name changes, even if its only one letter that changes from lowercase to uppercase.
This isn't that big of a deal, as it can sometimes be worked around by using a tool script or manual refactoring outside the engine to migrate the data, but can be a huge inconvenience as some languages (primarily C#) use different naming conventions for public/private variables respectively and require constantly changing variables from
camelCase
toPascalCase
and visa-versa to up-hold the recommend language naming conventions.This also affects GDScript and GDExtension users, as sometimes you want to rename a variable without risking losing all of its data and having to manually migrate the data over.
The solution
Add an auto-refactoring popup that shows up when the editor detects a script property on a node that doesn't belong to it's script.
This popup would be enabled by default as it is very useful to beginners, while letting users disable it to go back to the current behaviour of automatically removing export properties.
Implementation
This is far too complex for me to implement, and I'm still not sure about specific implementation details, so I'm calling for help via this discussion as this is a much appreciated workflow improvement and safety measure for the engine.
Beta Was this translation helpful? Give feedback.
All reactions