Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sooo, this is a draft PR trying to implement this: godotengine/godot-proposals#5832
For now, I'd rather limit the time I spend on it. My plan was to implement a first version without typing (as creating an editor capable of selecting a type, including scripts/classnamed objects, is a complex task).
For now it's not working properly. I think the only thing missing is likely at the "gdscript compilation" level, as I need to be able to assign the constant a value. However, the parser/analyser seems to be working fine, and does not spit any error when seing the new variable. However, at runtime, I get either errors or the singleton does not get assigned.
I'm just opening this PR to discuss if the implementation looks like going in the right direction, and if it is a desired feature of course (I like it a lot, having non-node and non-constant global variables is quite practical)