summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-10-18 16:54:58 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-10-18 16:54:58 +0200
commit49f492d54bf955e2d1621ede03debcf830618c68 (patch)
treef155d480862c998a993add3cebbbee35889b867a /modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs
parent0111637fd31b56acb96ad274eb25c459ea7f1579 (diff)
parentfe078219fcfa183397734d756a9a77ce3f6383f4 (diff)
downloadredot-engine-49f492d54bf955e2d1621ede03debcf830618c68.tar.gz
Merge pull request #83532 from raulsntos/dotnet/nested-class-generation
C#: Fix generated nested class order
Diffstat (limited to 'modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs')
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs
index 219ab7aa44..de44ada6de 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs
@@ -91,16 +91,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;
}
}