diff options
author | Raul Santos <raulsntos@gmail.com> | 2023-07-09 14:14:36 +0200 |
---|---|---|
committer | Raul Santos <raulsntos@gmail.com> | 2023-07-09 14:26:15 +0200 |
commit | 12e4aa93b3099b574468dc1a69679dcf1aa8c461 (patch) | |
tree | aead581205381203ad2bc1f64e4d0f6a135fa0e2 /modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs | |
parent | 83cc5d4914a6bff76069ac19191192337e4df3de (diff) | |
download | redot-engine-12e4aa93b3099b574468dc1a69679dcf1aa8c461.tar.gz |
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.
Diffstat (limited to 'modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs')
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs index ac908a6de3..4df16d05f0 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs @@ -285,10 +285,20 @@ namespace Godot.SourceGenerators { source.Append("#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword\n"); - string dictionaryType = + const string dictionaryType = "global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>"; source.Append("#if TOOLS\n"); + + source.Append(" /// <summary>\n") + .Append(" /// Get the default values for all properties declared in this class.\n") + .Append(" /// This method is used by Godot to determine the value that will be\n") + .Append(" /// used by the inspector when resetting properties.\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 "); source.Append(dictionaryType); source.Append(" GetGodotPropertyDefaultValues()\n {\n"); @@ -320,7 +330,8 @@ namespace Godot.SourceGenerators source.Append(" return values;\n"); source.Append(" }\n"); - source.Append("#endif\n"); + + source.Append("#endif // TOOLS\n"); source.Append("#pragma warning restore CS0109\n"); } |