You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on gdserialize, a schema-based serialization addon for Godot that works with JSON schema.
Describe the problem or limitation you are having in your project
As described in #8176, the naming of classes such as Serializer may lead to conflicts between addons. As the number of available assets for Godot increase with its popularity, a naming conflict is increasingly likely.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
The GDScript language should receive the ability to namespace classes in order to avoid conflicts.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Namespace naming
Namespaces are named similar to class names. Namespaces may not have the same name as a class. Namespaces may have sub-namespaces separated with a dot (.), similar to class members or inline classes.
The namespace keyword
This keyword would prefix the class_name keyword to specify a namespace:
Alternatively, a file-wide shorthand can be specified using the using keyword, which will attempt to resolve the specified class names in the global scope as well as in the specified namespaces. Multiple using keywords are allowed.
Describe the project you are working on
I'm working on gdserialize, a schema-based serialization addon for Godot that works with JSON schema.
Describe the problem or limitation you are having in your project
As described in #8176, the naming of classes such as
Serializer
may lead to conflicts between addons. As the number of available assets for Godot increase with its popularity, a naming conflict is increasingly likely.Describe the feature / enhancement and how it helps to overcome the problem or limitation
The GDScript language should receive the ability to namespace classes in order to avoid conflicts.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Namespace naming
Namespaces are named similar to class names. Namespaces may not have the same name as a class. Namespaces may have sub-namespaces separated with a dot (
.
), similar to class members or inline classes.The namespace keyword
This keyword would prefix the
class_name
keyword to specify a namespace:Namespaces may also be nested:
Referencing classes
Classes can be referenced by their full name:
Alternatively, a file-wide shorthand can be specified using the
using
keyword, which will attempt to resolve the specified class names in the global scope as well as in the specified namespaces. Multipleusing
keywords are allowed.If this enhancement will not be used often, can it be worked around with a few lines of script?
Class names can be prefixed with the desired namespace name. This will make the code less readable.
Is there a reason why this should be core and not an add-on in the asset library?
It is not possible to implement this as an add-on.
The text was updated successfully, but these errors were encountered: