mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
C#: Document generated members
Documents generated members and tries to discourage users from calling/overriding internal methods that only exist to be used by the engine.
This commit is contained in:
parent
83cc5d4914
commit
12e4aa93b3
8 changed files with 195 additions and 14 deletions
|
@ -176,6 +176,10 @@ namespace Godot.SourceGenerators
|
|||
|
||||
source.Append("#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword\n");
|
||||
|
||||
source.Append(" /// <summary>\n")
|
||||
.Append(" /// Cached StringNames for the signals contained in this class, for fast lookup.\n")
|
||||
.Append(" /// </summary>\n");
|
||||
|
||||
source.Append(
|
||||
$" public new class SignalName : {symbol.BaseType.FullQualifiedNameIncludeGlobal()}.SignalName {{\n");
|
||||
|
||||
|
@ -184,6 +188,13 @@ namespace Godot.SourceGenerators
|
|||
foreach (var signalDelegate in godotSignalDelegates)
|
||||
{
|
||||
string signalName = signalDelegate.Name;
|
||||
|
||||
source.Append(" /// <summary>\n")
|
||||
.Append(" /// Cached name for the '")
|
||||
.Append(signalName)
|
||||
.Append("' signal.\n")
|
||||
.Append(" /// </summary>\n");
|
||||
|
||||
source.Append(" public new static readonly global::Godot.StringName ");
|
||||
source.Append(signalName);
|
||||
source.Append(" = \"");
|
||||
|
@ -199,6 +210,14 @@ namespace Godot.SourceGenerators
|
|||
{
|
||||
const string listType = "global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo>";
|
||||
|
||||
source.Append(" /// <summary>\n")
|
||||
.Append(" /// Get the signal information for all the signals declared in this class.\n")
|
||||
.Append(" /// This method is used by Godot to register the available signals in the editor.\n")
|
||||
.Append(" /// Do not call this method.\n")
|
||||
.Append(" /// </summary>\n");
|
||||
|
||||
source.Append(" [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]\n");
|
||||
|
||||
source.Append(" internal new static ")
|
||||
.Append(listType)
|
||||
.Append(" GetGodotSignalList()\n {\n");
|
||||
|
@ -258,6 +277,8 @@ namespace Godot.SourceGenerators
|
|||
|
||||
if (godotSignalDelegates.Count > 0)
|
||||
{
|
||||
source.Append(" /// <inheritdoc/>\n");
|
||||
source.Append(" [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]\n");
|
||||
source.Append(
|
||||
" protected override void RaiseGodotClassSignalCallbacks(in godot_string_name signal, ");
|
||||
source.Append("NativeVariantPtrArgs args)\n {\n");
|
||||
|
@ -276,6 +297,8 @@ namespace Godot.SourceGenerators
|
|||
|
||||
if (godotSignalDelegates.Count > 0)
|
||||
{
|
||||
source.Append(" /// <inheritdoc/>\n");
|
||||
source.Append(" [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]\n");
|
||||
source.Append(
|
||||
" protected override bool HasGodotClassSignal(in godot_string_name signal)\n {\n");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue