Skip to content

Commit

Permalink
WTF
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyerst committed Mar 7, 2022
1 parent d40a7b0 commit f9d9adc
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion FastGenericNew.SourceGenerator/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public abstract class CodeGenerator
public virtual bool ShouldUpdate(in GeneratorOptions oldValue, in GeneratorOptions newValue) =>
oldValue.Namespace != newValue.Namespace
|| oldValue.MaxParameterCount != newValue.MaxParameterCount
|| oldValue.IsGeneratedHeader != newValue.IsGeneratedHeader
|| oldValue.AlertGeneratedFile != newValue.AlertGeneratedFile
|| oldValue.PrettyOutput != newValue.PrettyOutput;

public abstract CodeGenerationResult Generate(in GeneratorOptions options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ public static T SmartThrowImpl<T>(ConstructorInfo? constructor)

public override bool ShouldUpdate(in GeneratorOptions oldValue, in GeneratorOptions newValue) =>
oldValue.Namespace != newValue.Namespace
|| oldValue.IsGeneratedHeader != newValue.IsGeneratedHeader;
|| oldValue.AlertGeneratedFile != newValue.AlertGeneratedFile;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<CompilerVisibleProperty Include="FastNew_Namespace" />
<CompilerVisibleProperty Include="FastNew_DisableGeneratorCache" />
<CompilerVisibleProperty Include="FastNew_ForceFastNewDelegate" />
<CompilerVisibleProperty Include="FastNew_IsGeneratedHeader" />
<CompilerVisibleProperty Include="FastNew_AlertGeneratedFile" />
<CompilerVisibleProperty Include="FastNew_Trimmable" />
<CompilerVisibleProperty Include="FastNew_PrettyOutput" />
<CompilerVisibleProperty Include="FastNew_MultiThreadedGeneration" />
Expand Down
4 changes: 2 additions & 2 deletions FastGenericNew.SourceGenerator/GeneratorOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public readonly record struct GeneratorOptions

public bool ForceFastNewDelegate { get; }

public bool IsGeneratedHeader { get; }
public bool AlertGeneratedFile { get; }

public bool DisableGeneratorCache { get; }

Expand All @@ -51,7 +51,7 @@ public GeneratorOptions(AnalyzerConfigOptionsProvider? provider)
ForceFastNewDelegate = options.GetOrDefault(nameof(ForceFastNewDelegate), false);
Trimmable = options.GetOrDefault(nameof(Trimmable), true);

IsGeneratedHeader = options.GetOrDefault(nameof(IsGeneratedHeader), true);
AlertGeneratedFile = options.GetOrDefault(nameof(AlertGeneratedFile), true);
DisableGeneratorCache = options.GetOrDefault(nameof(DisableGeneratorCache), false);
PrettyOutput = options.GetOrDefault(nameof(PrettyOutput), false);
MultiThreadedGeneration = options.GetOrDefault(nameof(MultiThreadedGeneration), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ partial struct CodeBuilder
{
public void WriteFileHeader()
{
if (Options.IsGeneratedHeader)
if (Options.AlertGeneratedFile)
AppendLine(
@"//------------------------------------------------------------------------------
// <auto-generated>
Expand Down

0 comments on commit f9d9adc

Please sign in to comment.