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
Describe the problem or limitation you are having in your project
The default templates don't include a namespace for any of the included projects. It's common for C# files to be placed in a namespace as part of a project. This can help with a variety of patterns and organizations, especially of larger projects.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Currently there's no way to have the new class template in Godot generate with a namespace paired with the project you're working on, only static.
It's either you have to type it out each time for new classes you create, or have a fixed namespace which you'd go to change anyway.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The script templates for C# would be updated like so, for the base object for instance, it is currently:
// meta-description: Empty template suitable for all Objectsusing_BINDINGS_NAMESPACE_;usingSystem;publicpartialclass_CLASS_:_BASE_{}
It would become:
// meta-description: Empty template suitable for all Objectsusing_BINDINGS_NAMESPACE_;usingSystem;namespace_PROJECTNAME_;publicpartialclass_CLASS_:_BASE_{}
If you have a project named FooBar, then it would then be placed in a namespace of FooBar as well when creating new scripts.
This is also relevant to #1566 as if GDScript gets namespaces as well, it'd be prudent to include the similar option (if not default) for those templates as well.
If this enhancement will not be used often, can it be worked around with a few lines of script?
It's just more characters to type for every single new class you create via the editor. It's just one of those things that adds up over time.
Is there a reason why this should be core and not an add-on in the asset library?
The information about the project and how templates work seems integrated to the editor itself.
The text was updated successfully, but these errors were encountered:
Since we already have a placeholder with a underscore within it (_BINDINGS_NAMESPACE), should it be _PROJECT_NAME_ instead?
Also, not all project names are suitable identifiers, as they frequently contain spaces, colons or hyphens. The name would likely need to be converted automatically to an identifier-friendly format.
Describe the project you are working on
C# Games
Describe the problem or limitation you are having in your project
The default templates don't include a namespace for any of the included projects. It's common for C# files to be placed in a namespace as part of a project. This can help with a variety of patterns and organizations, especially of larger projects.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Currently there's no way to have the new class template in Godot generate with a namespace paired with the project you're working on, only static.
It's either you have to type it out each time for new classes you create, or have a fixed namespace which you'd go to change anyway.
This request was asked in the C# discussion of the Discord
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The script templates for C# would be updated like so, for the base object for instance, it is currently:
It would become:
If you have a project named
FooBar
, then it would then be placed in a namespace ofFooBar
as well when creating new scripts.This is also relevant to #1566 as if GDScript gets namespaces as well, it'd be prudent to include the similar option (if not default) for those templates as well.
If this enhancement will not be used often, can it be worked around with a few lines of script?
It's just more characters to type for every single new class you create via the editor. It's just one of those things that adds up over time.
Is there a reason why this should be core and not an add-on in the asset library?
The information about the project and how templates work seems integrated to the editor itself.
The text was updated successfully, but these errors were encountered: