From 959c1359e15ff74e46e4ceddf3c54fd890964bbc Mon Sep 17 00:00:00 2001 From: Alexandru Macocian Date: Tue, 22 Mar 2022 10:18:08 +0100 Subject: [PATCH] Small bugfix to normalize whitespace for method building --- Sybil.IntegrationTests/FlowTests.cs | 2 +- Sybil/MethodBuilder.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sybil.IntegrationTests/FlowTests.cs b/Sybil.IntegrationTests/FlowTests.cs index 8cae339..77bf053 100644 --- a/Sybil.IntegrationTests/FlowTests.cs +++ b/Sybil.IntegrationTests/FlowTests.cs @@ -6,7 +6,7 @@ namespace Sybil.IntegrationTests [TestClass] public sealed class FlowTests { - private const string ExpectedNamespace = + private const string ExpectedNamespace = @"namespace TestNamespace { using System; diff --git a/Sybil/MethodBuilder.cs b/Sybil/MethodBuilder.cs index be10508..d4c6f6e 100644 --- a/Sybil/MethodBuilder.cs +++ b/Sybil/MethodBuilder.cs @@ -83,15 +83,15 @@ namespace Sybil { if (this.BlockBody is null is false) { - return this.MethodDeclarationSyntax.WithBody(this.BlockBody); + return this.MethodDeclarationSyntax.WithBody(this.BlockBody).NormalizeWhitespace(); } if (this.ArrowExpression is null is false) { - return this.MethodDeclarationSyntax.WithExpressionBody(this.ArrowExpression); + return this.MethodDeclarationSyntax.WithExpressionBody(this.ArrowExpression).NormalizeWhitespace(); } - return this.MethodDeclarationSyntax; + return this.MethodDeclarationSyntax.NormalizeWhitespace(); } } }