Add leading trivia to all generated sources

// <auto-generated/>
このコミットが含まれているのは:
Sergio Pedri committed 2022-09-06 08:38:59 +02:00
1 親 579e9786e9
コミット fa03a6e612
4ファイル変更
+29 -16

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

+10
ファイルの表示
@@ -174,6 +174,11 @@ public sealed partial class ShaderMethodSourceGenerator : IIncrementalGenerator
/// <param name="methodSourceInfo">The input <see cref="HlslMethodSourceInfo"/> instance to use.</param>
public static CompilationUnitSyntax GetSyntax(HlslMethodSourceInfo methodSourceInfo)
{
// This produces an assembly attribute declaration as follows:
//
// // <auto-generated/>
// #pragma warning disable
// [assembly: global::ComputeSharp.ShaderMethodSourceAttribute(<ARGUMENTS>)]
return
CompilationUnit().AddAttributeLists(
AttributeList(SingletonSeparatedList(
@@ -184,6 +189,11 @@ public sealed partial class ShaderMethodSourceGenerator : IIncrementalGenerator
AttributeArgument(NestedArrayExpression(methodSourceInfo.DependentMethods)),
AttributeArgument(NestedArrayExpression(methodSourceInfo.DefinedConstants)))))
.WithOpenBracketToken(Token(TriviaList(Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))), SyntaxKind.OpenBracketToken, TriviaList()))
.WithOpenBracketToken(Token(TriviaList(
Comment("// <auto-generated/>"),
Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true))),
SyntaxKind.OpenBracketToken,
TriviaList()))
.WithTarget(AttributeTargetSpecifier(Token(SyntaxKind.AssemblyKeyword))))
.NormalizeWhitespace(eol: "\n");
}