Skip to content

Commit

Permalink
Source generator: Remove timing diagnostic, disable resharper analysis.
Browse files Browse the repository at this point in the history
  • Loading branch information
CallumDev committed Oct 16, 2023
1 parent f41305f commit 50e7a07
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/WattleScript.HardwireGen/SourceGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ public partial class HardwireSourceGenerator : ISourceGenerator
"Type '{0}' from AdditionalFile '{1}' could not be resolved.",
"WattleScript.HardwireGen", DiagnosticSeverity.Warning, true);

private static DiagnosticDescriptor Timing = new("MS9999", "Generation duration",
"Hardwire generation took '{0}'ms", "WattleScript.HardwireGen", DiagnosticSeverity.Info, true);

public void Initialize(GeneratorInitializationContext context)
{
context.RegisterForSyntaxNotifications(() => new UserDataSyntaxReceiver());
Expand Down Expand Up @@ -180,6 +177,7 @@ public void Execute(GeneratorExecutionContext context)

var writer = new TabbedWriter();
writer.AppendLine("// <auto-generated />");
writer.AppendLine("// ReSharper disable All");
writer.Append("partial class ").AppendLine(name);
writer.AppendLine("{").Indent();
writer.AppendLine("public static void Initialize()");
Expand All @@ -193,7 +191,6 @@ public void Execute(GeneratorExecutionContext context)
writer.UnIndent().AppendLine("}");
context.AddSource($"{name}.g.cs", writer.ToString());
sw.Stop();
context.ReportDiagnostic(Diagnostic.Create(Timing, null, sw.Elapsed.TotalMilliseconds));
}
catch (Exception e)
{
Expand Down Expand Up @@ -260,6 +257,7 @@ void GenerateCode(ref GeneratorExecutionContext context, string containingName,
Dictionary<string, TypeMethod> methods = new Dictionary<string, TypeMethod>();
Dictionary<string, TypeField> fields = new Dictionary<string, TypeField>();
builder.AppendLine("// <auto-generated />");
builder.AppendLine("// ReSharper disable All");
builder.Append("// UserData description for: ").AppendLine(typeName);

builder.Append("internal partial class ").Append(containingName).AppendLine().AppendLine("{").Indent();
Expand Down

0 comments on commit 50e7a07

Please sign in to comment.