diff --git a/gen/SourceGenerator/ImmutableGenerator.cs b/gen/SourceGenerator/ImmutableGenerator.cs index 3a5832536..54ea9101b 100644 --- a/gen/SourceGenerator/ImmutableGenerator.cs +++ b/gen/SourceGenerator/ImmutableGenerator.cs @@ -56,17 +56,19 @@ static string GenerateImmutableClass(TypeDeclarationSyntax mutableClass, Compila } """; - const string template = @"{Usings} + const string template = """ + {Usings} -namespace {Namespace}; + namespace {Namespace}; -public partial class ReadOnly{ClassName} { -{Constructor} + public partial class ReadOnly{ClassName} { + {Constructor} + + partial void CopyAdditionalProperties({ClassName} {ArgName}); - partial void CopyAdditionalProperties({ClassName} {ArgName}); - -{Properties} -}"; + {Properties} + } + """; var code = template .Replace("{Usings}", string.Join("\n", usings))