Skip to content

Commit 50e7a07

Browse files
committed
Source generator: Remove timing diagnostic, disable resharper analysis.
1 parent f41305f commit 50e7a07

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/WattleScript.HardwireGen/SourceGenerator.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ public partial class HardwireSourceGenerator : ISourceGenerator
2525
"Type '{0}' from AdditionalFile '{1}' could not be resolved.",
2626
"WattleScript.HardwireGen", DiagnosticSeverity.Warning, true);
2727

28-
private static DiagnosticDescriptor Timing = new("MS9999", "Generation duration",
29-
"Hardwire generation took '{0}'ms", "WattleScript.HardwireGen", DiagnosticSeverity.Info, true);
30-
3128
public void Initialize(GeneratorInitializationContext context)
3229
{
3330
context.RegisterForSyntaxNotifications(() => new UserDataSyntaxReceiver());
@@ -180,6 +177,7 @@ public void Execute(GeneratorExecutionContext context)
180177

181178
var writer = new TabbedWriter();
182179
writer.AppendLine("// <auto-generated />");
180+
writer.AppendLine("// ReSharper disable All");
183181
writer.Append("partial class ").AppendLine(name);
184182
writer.AppendLine("{").Indent();
185183
writer.AppendLine("public static void Initialize()");
@@ -193,7 +191,6 @@ public void Execute(GeneratorExecutionContext context)
193191
writer.UnIndent().AppendLine("}");
194192
context.AddSource($"{name}.g.cs", writer.ToString());
195193
sw.Stop();
196-
context.ReportDiagnostic(Diagnostic.Create(Timing, null, sw.Elapsed.TotalMilliseconds));
197194
}
198195
catch (Exception e)
199196
{
@@ -260,6 +257,7 @@ void GenerateCode(ref GeneratorExecutionContext context, string containingName,
260257
Dictionary<string, TypeMethod> methods = new Dictionary<string, TypeMethod>();
261258
Dictionary<string, TypeField> fields = new Dictionary<string, TypeField>();
262259
builder.AppendLine("// <auto-generated />");
260+
builder.AppendLine("// ReSharper disable All");
263261
builder.Append("// UserData description for: ").AppendLine(typeName);
264262

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

0 commit comments

Comments
 (0)