Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/ReswPlus.SourceGenerator/CodeGenerators/CsharpCodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ namespace ReswPlus.SourceGenerator.CodeGenerators;
/// <example>
/// The generated code may look similar to the following:
/// <code language="csharp">
/// // File generated automatically by ReswPlus. https://github.com/DotNetPlus/ReswPlus
/// // <auto-generated>
/// // This code was generated by ReswPlus (https://github.com/DotNetPlus/ReswPlus). Do not edit this file directly.
/// // </auto-generated>
/// using System;
/// using Windows.UI.Xaml.Markup;
/// using Windows.UI.Xaml.Data;
Expand Down Expand Up @@ -67,14 +69,18 @@ public IEnumerable<GeneratedFile> GetGeneratedFiles(string? baseFilename, Strong
{
// Create a header comment that will be placed at the top of the generated file.
var headerTrivia = TriviaList(
Comment("// File generated automatically by ReswPlus. https://github.com/DotNetPlus/ReswPlus"),
Comment("""
// <auto-generated>
// This code was generated by ReswPlus (https://github.com/DotNetPlus/ReswPlus). Do not edit this file directly.
// </auto-generated>
"""),
CarriageReturnLineFeed
);

// Build the compilation unit (the root node of a C# file) and add required using directives.
var compilationUnit = CompilationUnit()
.WithLeadingTrivia(headerTrivia)
.WithUsings(List(GetUsings(info.AppType)));
.WithUsings(List(GetUsings(info.AppType)))
.WithLeadingTrivia(headerTrivia);

// Create the strongly-typed static class declaration (the class that will provide resource lookup).
var strongClassDecl = CreateStronglyTypedClass(info);
Expand Down