-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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#: Document generated members #79239
C#: Document generated members #79239
Conversation
Documents generated members and tries to discourage users from calling/overriding internal methods that only exist to be used by the engine.
66cc220
to
12e4aa9
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.
tries to discourage users from calling/overriding internal methods that only exist to be used by the engine.
Should even properly document them in xml docs then or should we just have the warning not to use them and whatever is is necessary to suppress the warnings?
Related: net8 adds an Experimental
attribute for things like this: https://github.com/dotnet/designs/blob/main/accepted/2023/preview-apis/preview-apis.md which we could use for these methods once that is released. Or alternatively we could mark these things Obsolete
to generate a warning right now when using them.
modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptMethodsGenerator.cs
Show resolved
Hide resolved
I don't feel like the
Some of these methods are used by source generators so this would generate warnings for users that don't use them directly. Also, it would generate warnings for us in the GodotSharp project.
I think documenting them is useful, because it can be helpful for contributors. I don't think it's that important for users not to call these methods, just letting them know that they are not mean to and hiding them so they don't accidentally stumble upon them is enough. |
With the |
My concern is that since some of these methods are used by source generators, those warnings would show up in user projects even if they are not using them directly. Also, technically we should avoid breaking compat in these methods too, because an external library built against Godot 4.0 could be using them. For example, if a library implements a Node type that the user derives from in their game project, then I think the generated And I see what you mean now by using |
Thanks! |
Documents generated members and tries to discourage users from calling/overriding internal methods that only exist to be used by the engine.