diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-06 20:40:09 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-06-06 20:40:09 +0200 |
commit | 0a0132ccf40b14d2ca8987193b3b07a5fe03a674 (patch) | |
tree | 9ad430fa98327d63087658c1a7aab1558c90aa19 | |
parent | 2a1bc05901ec8644911544a085f1e618bd8cc627 (diff) | |
parent | 0484993121807a3ae47c93cf7c8f78d1cf804058 (diff) | |
download | redot-engine-0a0132ccf40b14d2ca8987193b3b07a5fe03a674.tar.gz |
Merge pull request #77904 from raulsntos/dotnet/obsolete-deprecated-members
C#: Add `[Obsolete]` attribute to deprecated members
-rw-r--r-- | modules/mono/editor/bindings_generator.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 6b52c8eaaf..7c6328e922 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -1375,6 +1375,10 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str output.append("/// </summary>\n"); } + + if (class_doc->is_deprecated) { + output.append("[Obsolete(\"This class is deprecated.\")]\n"); + } } // We generate a `GodotClassName` attribute if the engine class name is not the same as the @@ -1426,6 +1430,10 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str output.append(INDENT1 "/// </summary>"); } + + if (iconstant.const_doc->is_deprecated) { + output.append(MEMBER_BEGIN "[Obsolete(\"This constant is deprecated.\")]"); + } } output.append(MEMBER_BEGIN "public const long "); @@ -1470,6 +1478,10 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str output.append(INDENT2 "/// </summary>\n"); } + + if (iconstant.const_doc->is_deprecated) { + output.append(INDENT2 "[Obsolete(\"This enum member is deprecated.\")]\n"); + } } output.append(INDENT2); @@ -1867,6 +1879,10 @@ Error BindingsGenerator::_generate_cs_property(const BindingsGenerator::TypeInte p_output.append(INDENT1 "/// </summary>"); } + + if (p_iprop.prop_doc->is_deprecated) { + p_output.append(MEMBER_BEGIN "[Obsolete(\"This property is deprecated.\")]"); + } } p_output.append(MEMBER_BEGIN "public "); @@ -2102,6 +2118,10 @@ Error BindingsGenerator::_generate_cs_method(const BindingsGenerator::TypeInterf p_output.append(INDENT1 "/// </summary>"); } + + if (p_imethod.method_doc->is_deprecated) { + p_output.append(MEMBER_BEGIN "[Obsolete(\"This method is deprecated.\")]"); + } } if (default_args_doc.get_string_length()) { @@ -2314,6 +2334,10 @@ Error BindingsGenerator::_generate_cs_signal(const BindingsGenerator::TypeInterf p_output.append(INDENT1 "/// </summary>"); } + + if (p_isignal.method_doc->is_deprecated) { + p_output.append(MEMBER_BEGIN "[Obsolete(\"This signal is deprecated.\")]"); + } } if (p_isignal.is_deprecated) { |