Skip to content

Commit 263d406

Browse files
committed
Fixed leading trivia in some generated files
1 parent 79b36fb commit 263d406

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Microsoft.Toolkit.Mvvm.SourceGenerators/ComponentModel/TransitiveMembersGenerator.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,12 @@ private void OnExecute(
157157
CompilationUnit()
158158
.AddMembers(NamespaceDeclaration(IdentifierName(namespaceName))
159159
.AddMembers(typeDeclarationSyntax))
160-
.AddUsings(usingDirectives.ToArray())
160+
.AddUsings(usingDirectives.First().WithLeadingTrivia(TriviaList(
161+
Comment("// Licensed to the .NET Foundation under one or more agreements."),
162+
Comment("// The .NET Foundation licenses this file to you under the MIT license."),
163+
Comment("// See the LICENSE file in the project root for more information."),
164+
Trivia(PragmaWarningDirectiveTrivia(Token(SyntaxKind.DisableKeyword), true)))))
165+
.AddUsings(usingDirectives.Skip(1).ToArray())
161166
.NormalizeWhitespace()
162167
.ToFullString();
163168

0 commit comments

Comments
 (0)