diff --git a/src/ComputeSharp.SourceGenerators/IComputeShaderSourceGenerator.cs b/src/ComputeSharp.SourceGenerators/IComputeShaderSourceGenerator.cs index fa51f8ba..88c6e92c 100644 --- a/src/ComputeSharp.SourceGenerators/IComputeShaderSourceGenerator.cs +++ b/src/ComputeSharp.SourceGenerators/IComputeShaderSourceGenerator.cs @@ -78,7 +78,7 @@ namespace ComputeSharp.SourceGenerators var processedMembers = GetProcessedMembers(structDeclarationSymbol, discoveredTypes).ToArray(); var (entryPoint, localFunctions) = GetProcessedMethods(structDeclaration, structDeclarationSymbol, semanticModel, discoveredTypes, staticMethods); var processedTypes = GetProcessedTypes(discoveredTypes).ToArray(); - var processedMethods = localFunctions.Concat(staticMethods.Values.Select(static method => method.ToFullString())).ToArray(); + var processedMethods = localFunctions.Concat(staticMethods.Values).Select(static method => method.ToFullString()).ToArray(); // Create the compilation unit with the source attribute var source = @@ -140,7 +140,7 @@ namespace ComputeSharp.SourceGenerators /// The set of discovered and processed static methods. /// A sequence of processed methods in , and the entry point. [Pure] - private static (string EntryPoint, IEnumerable Methods) GetProcessedMethods( + private static (string EntryPoint, IEnumerable Methods) GetProcessedMethods( StructDeclarationSyntax structDeclaration, INamedTypeSymbol structDeclarationSymbol, SemanticModel semanticModel, @@ -154,7 +154,7 @@ namespace ComputeSharp.SourceGenerators select (MethodDeclarationSyntax)syntaxNode).ToImmutableArray(); string? entryPoint = null; - List methods = new(); + List methods = new(); foreach (MethodDeclarationSyntax methodDeclaration in methodDeclarations) { @@ -177,12 +177,12 @@ namespace ComputeSharp.SourceGenerators entryPoint = processedMethod.NormalizeWhitespace().ToFullString(); } - else methods.Add(processedMethod.NormalizeWhitespace().ToFullString()); + else methods.Add(processedMethod); // Emit the extracted local functions foreach (var localFunction in shaderSourceRewriter.LocalFunctions) { - methods.Add(localFunction.Value.NormalizeWhitespace().ToFullString()); + methods.Add(localFunction.Value); } }