diff options
author | Raul Santos <raulsntos@gmail.com> | 2023-10-18 03:25:24 +0200 |
---|---|---|
committer | Raul Santos <raulsntos@gmail.com> | 2023-10-18 03:37:57 +0200 |
commit | fe078219fcfa183397734d756a9a77ce3f6383f4 (patch) | |
tree | 7c28ff8398ea263558f33acf27951b2ef851f922 /modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs | |
parent | dce1aab174369e9124507f4614fc007301df52e7 (diff) | |
download | redot-engine-fe078219fcfa183397734d756a9a77ce3f6383f4.tar.gz |
C#: Fix generated nested class order
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 | 10 |
1 files changed, 7 insertions, 3 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 4df16d05f0..fc0bfbf084 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs @@ -88,16 +88,20 @@ namespace Godot.SourceGenerators if (isInnerClass) { var containingType = symbol.ContainingType; + AppendPartialContainingTypeDeclarations(containingType); - while (containingType != null) + void AppendPartialContainingTypeDeclarations(INamedTypeSymbol? containingType) { + if (containingType == null) + return; + + AppendPartialContainingTypeDeclarations(containingType.ContainingType); + source.Append("partial "); source.Append(containingType.GetDeclarationKeyword()); source.Append(" "); source.Append(containingType.NameWithTypeParameters()); source.Append("\n{\n"); - - containingType = containingType.ContainingType; } } |