-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The "Attach Node Script" dialog should suggest snake_case file names, consistent with the documentation #1211
Comments
Those methods exist, but they are not part of core currently, see my proposal #719. |
I think scene names should be snake_case too, otherwise it doesn't make much sense. And the script name already uses scene name, so they are consistent. |
To anyone implementing this: The convention should be changed automatically depending on the target language. It should not apply when using C#, which uses PascalCase for file names (the file name should be the same as the class name). |
pls no this should be a option not a requirement |
@Shadowblitz16 Both would still be an option. This is just suggesting that the default option should be consistent with the documentation. |
@KoBeWi I might be wrong, but doesn't it use the name of the node you attach it to? (which should be PascalCase) Also, I previously had been using PascalCase for scene names, but I think you're right. If Godot as an engine wants to start formally autosuggesting snake case for script names, it should do it for scene names too. The snake case next to the node icons in the editor itself will take some getting used to, but I guess it's consistent. EDIT: Apparently the script does suggest the scene name, but only if it is the root node. Otherwise, it suggests the name of the node. This means that if you use snake case for scene files, the root node will have a script name suggested in snake case, but all other nodes will have a script name suggested in pascal case. |
Actually it's both. It uses scene name when script is attached to root and node name for other nodes. |
That's funny. I just realized that and edited my comment, but before I saw your reply just now. |
I wonder if the docs are wrong or the save dialog: The docs say it should be snake_case but the dialog proposes PascalCase. Further, all tutorials I've seen so far, even the ones within the Godot docs, use PascalCase. In each case consistency should be applied everywhere: In the dialogs and in the docs (not just on the styleguide page). |
For saving scenes, we've established that the save dialog is wrong. Documentation that still uses PascalCase scene file names should be updated to use snake_case instead. |
I asked people and it seems like everybody is kinda doing their own thing when it comes to naming conventions: There probably should be an additional dropdown on this screen for script names, with the default being whatever the documentation is recommending: |
i think many people (like me) started using pascal case for scripts because it’s what this box suggests. working with people and online resources that use different conventions is annoying, you can retype it if you really want to be different but i don’t think the engine should promote this with having a pascal case option |
After constantly renaming script file names to snake case, I support this as a potential feature, it would be nice to have a more consistent naming of script names according to the official convention stated by docs. It should be an option as well for people who want it to continue to default to PascalCase |
From the closed as duplicate #9199 there was a new suggestion which should be considered as well:
Could be done as a follow-up PR, in which case this should likely be moved to a new dedicated design task. |
The thing with this setting is that it only applies to scripts on nodes that are saved as a scene. So if I save my BaseTower node as a scene and attach the script then it suggests the name |
Describe the project you are working on: A 2D rhythm platformer
Describe the problem or limitation you are having in your project: The GDScript Style Guide page on the documentation says that per the style guide, GDScript file names should be in snake case. However, the 'Attach Node Script' dialog suggests the same name as the node, in pascal case by default.
Describe the feature / enhancement and how it helps to overcome the problem or limitation: To achieve consistency with the documentation, the autocompleted file name should be converted to snake case.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: From what I have heard, Godot already has case conversion methods, so it should be easy to just convert pascal to snake case.
If this enhancement will not be used often, can it be worked around with a few lines of script?: N/A
Is there a reason why this should be core and not an add-on in the asset library?: It is more consistent with the (core) documentation.
The text was updated successfully, but these errors were encountered: