-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
C#: Improve binding generator checks/passes #79475
Conversation
Diffs caused by this: https://gist.github.com/RedworkDE/731e64edd3002d34416bb91c4eb3d8f5 |
f2b578d
to
fcc7f2d
Compare
The logic for those "new" checks will take more time to think about than I expected, so I'll remove that section for now. So instead of focusing on clearing up warnings specifically, this is now more about QOL for |
fcc7f2d
to
3318845
Compare
https://gist.github.com/RedworkDE/46aeeffb844a61b9cae78117ba18f389 diffs got a whole lot bigger, generally look good, but I haven't looked at this in detail yet. |
Ohhh yeah, they're way bigger thanks to the documentation additions |
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.
I haven't reviewed the diff yet, but I have looked at the code changes and left some comments.
Some of these changes overlap with #79239. I prefer the documentation I wrote but I'm biased 😄.
3318845
to
5b56ed7
Compare
I preferred your documentation too, so I just used that instead where applicable. Because it didn't use specific class references, I was able to trim a TON of the excess generation size via |
d0b6d27
to
58bdc13
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
Are there any particular reasons to use |
The size is the only real advantage I can think of, but at the same time I can't think of a reason not to do it if the documentation would otherwise be identical. That is to say, if we think it's worth making specific class references in the documentation, then we could drop |
58bdc13
to
87b3905
Compare
New update that fixes core documentation attempting to reference editor api. If I can figure out a way to safely handle Also, in fixing that last bit, I realized that the |
• Enum types will now properly utilize pascal case when referenced in the documentation • paramrefs now properly tagged in documentation, unless they're part of a signal • Implemented basic docstrings for public auto-generated methods/values • Fixed delegate docstring logic so it doesn't cause double-summaries • xml methods now include their argument types, preventing ambiguous references
87b3905
to
049c5de
Compare
@raulsntos I think I've got something figured out for the "new" situation! This updated setup brings back the old method, but utilizes a newly added |
Can you split the PR by diagnostic Id? I think it'd be easier to review that way. Some of the changes in this PR are straight-forward and I'd like to approve them but I'm not so sure about the other changes.
The documentation will be identical, but adding extra code to the bindings generator (which is written manually) to make generated code cleaner doesn't seem like an improvement to me. In general, we should prioritize cleaner code in the non-generated code since it's the code that we have to write and maintain ourselves, the generated code can be as long and repetitive as we want since it's machine-generated.
I think it's weird that GodotSharp API is referencing GodotSharpEditor API, I'd like to take a better look at why that's happening.
So the warning is silenced in the .NET compiler and then we print it manually to the console? I'm not sure how people that compile with |
That… Is a very good point. It should be safe to revert that then
Maybe "warning" is a misnomer, and it should be something more like
That being, the type of warning/case that is addressed? That should be simple enough if so |
I don't mind the name. I was just thinking that if someone is using dotnet_diagnostic.CS0108.severity = none
Yeah, the diagnostic Id reported by MSBuild. I think splitting the PR by the list mentioned in the PR description should be good:
This one causes CS1574.
This doesn't actually cause a diagnostic, but I still think it'd be better as a separate PR.
This one doesn't cause a diagnostic either, but I feel like it would be better separated too.
I guess this one doesn't cause a diagnostic? But I would also separate it.
This one causes CS0419. |
Closing as everything here has been implemented/superseded elsewhere. |
This is in a similar vein to my other PR, #79351, but it's more involved as it directly changes codeblocks within
bindings_generator.cpp
so it warrants seperation imo. The main changes areEnum types will now properly utilize pascal case when referenced in the documentationproxy_name
for EnumInterface #80628paramref
now properly tagged in documentation, unless they're part of a signalFixed delegate docstring logic so it doesn't cause double-summariesGenerated methods now include their argument types, preventing ambiguous references withCompat.cs
Fixed core documentation attempting to reference editor api