Skip to content

Commit

Permalink
tried to fix line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin Wilmans committed Apr 16, 2024
1 parent 5dfdd14 commit 7b8f7d9
Showing 1 changed file with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,33 @@ namespace AutomaticInterface;
public class AutomaticInterfaceGenerator : IIncrementalGenerator
{
public const string DefaultAttributeName = "GenerateAutomaticInterface";

public void Initialize(IncrementalGeneratorInitializationContext context)
{
context.RegisterPostInitializationOutput(static postInitializationContext =>
{
postInitializationContext.AddSource(
$"{DefaultAttributeName}.Attribute.g.cs",
SourceText.From(
$$$"""
// <auto-generated />
using System;
namespace AutomaticInterface
{
/// <summary>
/// Use source generator to automatically create a Interface from this class
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
internal sealed class {{{DefaultAttributeName}}}Attribute : Attribute
{
internal {{{DefaultAttributeName}}}Attribute(string namespaceName = "") { }
}
}
""",
Encoding.UTF8
)
);
context.RegisterPostInitializationOutput(static postInitializationContext =>
{
postInitializationContext.AddSource(
$"{DefaultAttributeName}.Attribute.g.cs",
SourceText.From(
$$$"""
// <auto-generated />
using System;
namespace AutomaticInterface
{
/// <summary>
/// Use source generator to automatically create a Interface from this class
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
internal sealed class {{{DefaultAttributeName}}}Attribute : Attribute
{
internal {{{DefaultAttributeName}}}Attribute(string namespaceName = "") { }
}
}
""",
Encoding.UTF8
)
);
});

var classes = context
Expand Down

0 comments on commit 7b8f7d9

Please sign in to comment.