Skip to content

Commit d571102

Browse files
committed
Use [Diagnostic].Report() method in IncrementalGenerator API
1 parent d461701 commit d571102

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/roslyn/Riverside.CompilerPlatform.SourceGenerators/IncrementalGenerator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using Riverside.CompilerPlatform.Extensions;
2+
using System;
23
using System.Collections.Generic;
34
using System.Diagnostics;
45
using System.Linq;
@@ -249,12 +250,11 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
249250
if (!SuppressDiagnostics)
250251
{
251252
// Report exceptions that occur during generation
252-
sourceProductionContext.ReportDiagnostic(
253253
CreateDiagnostic(
254254
$"RS9999",
255255
"Source Generation Error",
256256
$"An error occurred during source generation: {ex.Message}",
257-
DiagnosticSeverity.Error));
257+
DiagnosticSeverity.Error).Report(Context);
258258
}
259259
}
260260
});

0 commit comments

Comments
 (0)