-
-
Notifications
You must be signed in to change notification settings - Fork 586
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
Fix some style details in generation #1423
Conversation
Thanks! In my testing this fixes some of the style issues from the description, but creates some new ones. For example, with I diff'd the generated code between Here's the diff I generated, in case it's helpful: godot-cpp-pr-1423-diff.txt |
Thank you, will look at those cases, should be straightforward |
27a7b4f
to
f2f973d
Compare
Should be good now! (Pushed on top of #1490 for the time being for conflicts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! All the changes this makes look good to me now :-)
There is at least one style issue this doesn't fix which I noticed while reviewing. I did a diff on the gen/
directory for before and after the last commit on this branch and noticed a missing space after const
in a couple places, for example:
diff -Nur gen-old/src/variant/signal.cpp gen/src/variant/signal.cpp
--- gen-old/src/variant/signal.cpp 2024-06-17 16:32:02.756419960 -0500
+++ gen/src/variant/signal.cpp 2024-06-17 16:32:07.316546358 -0500
@@ -117,7 +117,7 @@
return internal::_call_builtin_method_ptr_ret<int8_t>(_method_bindings.method_is_null, (GDExtensionTypePtr)&opaque);
}
-Object *Signal::get_object() const{
+Object *Signal::get_object() const{
return internal::_call_builtin_method_ptr_ret_obj<Object>(_method_bindings.method_get_object, (GDExtensionTypePtr)&opaque);
}
However, the changes this PR makes are all positive, so we don't have to fix that here (unless you want to).
I'll see if I can find those, but I'm fine merging this and checking later, I'll push in a few hours if I do, otherwise I'll do it later |
f2f973d
to
d0b63aa
Compare
Fixed! There are some other areas of style that might be improved in the future, will do some testing using Edit: Found a few more glaring cases I'll fix right now |
d0b63aa
to
9fd5f8d
Compare
@@ -1545,8 +1549,6 @@ def generate_engine_class_header(class_api, used_classes, fully_used_classes, us | |||
vararg = "is_vararg" in method and method["is_vararg"] | |||
|
|||
method_signature = "\t" | |||
if vararg: | |||
method_signature += "private: " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already added by the make_signature
method so was added doubly
9fd5f8d
to
e7a13e3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I skimmed through the diff of the generated code after the latest changes, and this is looking really great to me :-)
Thank you! Got some further fixes set up but still testing them and will open a PR when they are ready, they're more extensive but will (almost) make the generared code follow the style, i.e. won't be triggering anything in |
Cherry-picked for 4.2 in PR #1527 |
Cherry-picked for 4.1 in PR #1529 |
Some minor output fixes that I came across while fixing some other bugs, this would generate things like:
These are all now fixed