1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

C#: Fix generated nested class order

This commit is contained in:
Raul Santos
2023-10-18 03:25:24 +02:00
parent dce1aab174
commit fe078219fc
7 changed files with 71 additions and 21 deletions

View File

@@ -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;
}
}