Switched source generated files to only use LF line endings

このコミットが含まれているのは:
Sergio Pedri committed 2021-07-12 16:43:43 +02:00
1 親 632cd6faf5
コミット 6fbcf21f74
6ファイル変更
+18 -18

検索条件に一致するファイルはありません

+1 -1
ファイルの表示
@@ -101,7 +101,7 @@ namespace ComputeSharp.SourceGenerators
var source =
CompilationUnit().AddMembers(
NamespaceDeclaration(IdentifierName(namespaceName)).AddMembers(typeDeclarationSyntax))
.NormalizeWhitespace()
.NormalizeWhitespace(eol: "\n")
.ToFullString();
// Add the partial type
+9 -9
ファイルの表示
@@ -228,7 +228,7 @@ namespace ComputeSharp.SourceGenerators
constantDefinitions,
context);
string? assignment = staticFieldRewriter.Visit(variableDeclarator)?.NormalizeWhitespace().ToFullString();
string? assignment = staticFieldRewriter.Visit(variableDeclarator)?.NormalizeWhitespace(eol: "\n").ToFullString();
yield return (mapping ?? fieldSymbol.Name, typeDeclaration, assignment);
}
@@ -350,8 +350,8 @@ namespace ComputeSharp.SourceGenerators
// Emit the extracted local functions first
foreach (var localFunction in shaderSourceRewriter.LocalFunctions)
{
methods.Add(localFunction.Value.NormalizeWhitespace().ToFullString());
declarations.Add(localFunction.Value.AsDefinition().NormalizeWhitespace().ToFullString());
methods.Add(localFunction.Value.NormalizeWhitespace(eol: "\n").ToFullString());
declarations.Add(localFunction.Value.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString());
}
// If the method is the shader entry point, do additional processing
@@ -363,20 +363,20 @@ namespace ComputeSharp.SourceGenerators
false => new ExecuteMethodRewriter.Pixel(shaderSourceRewriter).Visit(processedMethod)!
};
entryPoint = processedMethod.NormalizeWhitespace().ToFullString();
entryPoint = processedMethod.NormalizeWhitespace(eol: "\n").ToFullString();
}
else
{
methods.Add(processedMethod.NormalizeWhitespace().ToFullString());
declarations.Add(processedMethod.AsDefinition().NormalizeWhitespace().ToFullString());
methods.Add(processedMethod.NormalizeWhitespace(eol: "\n").ToFullString());
declarations.Add(processedMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString());
}
}
// Process static methods as well
foreach (MethodDeclarationSyntax staticMethod in staticMethods.Values)
{
methods.Add(staticMethod.NormalizeWhitespace().ToFullString());
declarations.Add(staticMethod.AsDefinition().NormalizeWhitespace().ToFullString());
methods.Add(staticMethod.NormalizeWhitespace(eol: "\n").ToFullString());
declarations.Add(staticMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString());
}
return (entryPoint!, methods, declarations, isSamplerUsed);
@@ -431,7 +431,7 @@ namespace ComputeSharp.SourceGenerators
// Insert the trailing ; right after the closing bracket (after normalization)
yield return
structDeclaration
.NormalizeWhitespace()
.NormalizeWhitespace(eol: "\n")
.WithSemicolonToken(Token(SyntaxKind.SemicolonToken))
.ToFullString();
}
+1 -1
ファイルの表示
@@ -150,7 +150,7 @@ namespace ComputeSharp.SourceGenerators
UsingDirective(IdentifierName("ComputeSharp.__Internals"))).AddMembers(
NamespaceDeclaration(IdentifierName(namespaceName)).AddMembers(typeDeclarationSyntax)
.WithNamespaceKeyword(Token(TriviaList(Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))), SyntaxKind.NamespaceKeyword, TriviaList())))
.NormalizeWhitespace()
.NormalizeWhitespace(eol: "\n")
.ToFullString();
// Add the method source attribute
+3 -3
ファイルの表示
@@ -87,7 +87,7 @@ namespace ComputeSharp.SourceGenerators
AttributeArgument(NestedArrayExpression(Array.Empty<string[]>()))))) // TODO
.WithOpenBracketToken(Token(TriviaList(Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))), SyntaxKind.OpenBracketToken, TriviaList()))
.WithTarget(AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword))))
.NormalizeWhitespace()
.NormalizeWhitespace(eol: "\n")
.ToFullString();
// Add the method source attribute
@@ -120,7 +120,7 @@ namespace ComputeSharp.SourceGenerators
.Visit(methodDeclaration)!
.WithIdentifier(Identifier(ShaderMethodSourceAttribute.InvokeMethodIdentifier))
.WithoutTrivia()
.NormalizeWhitespace()
.NormalizeWhitespace(eol: "\n")
.ToFullString();
List<string> localFunctions = new(shaderSourceRewriter.LocalFunctions.Count);
@@ -128,7 +128,7 @@ namespace ComputeSharp.SourceGenerators
// Emit the extracted local functions
foreach (var localFunction in shaderSourceRewriter.LocalFunctions)
{
localFunctions.Add(localFunction.Value.NormalizeWhitespace().ToFullString());
localFunctions.Add(localFunction.Value.NormalizeWhitespace(eol: "\n").ToFullString());
}
return (targetMethod, localFunctions);
+1 -1
ファイルの表示
@@ -406,7 +406,7 @@ namespace ComputeSharp.SourceGenerators.SyntaxRewriters
ShaderSourceRewriter shaderSourceRewriter = new(SemanticModel, DiscoveredTypes, this.staticMethods, ConstantDefinitions, Context);
MethodDeclarationSyntax
methodNode = (MethodDeclarationSyntax)method.DeclaringSyntaxReferences[0].GetSyntax(),
processedMethod = shaderSourceRewriter.Visit(methodNode)!.NormalizeWhitespace().WithoutTrivia();
processedMethod = shaderSourceRewriter.Visit(methodNode)!.NormalizeWhitespace(eol: "\n").WithoutTrivia();
this.staticMethods.Add(method, processedMethod.WithIdentifier(Identifier(methodIdentifier)));
}