MLLIF
a MLIR-based Language to Language Interoperability Flyover
Loading...
Searching...
No Matches
DiagnosticExtension.cs
Go to the documentation of this file.
1using Microsoft.CodeAnalysis;
2
4
5public static class DiagnosticExtension
6{
7 public static void PrintDiagnostics(this IEnumerable<WorkspaceDiagnostic> diagnostics)
8 {
9 foreach (var diagnostic in diagnostics)
10 {
11 if (diagnostic is not BindingDiagnostic)
12 {
13 var type = diagnostic.GetType();
14 Console.Error.WriteLine($"unrecommended diagnostic type: {type.FullName ?? type.Name}");
15 }
16
17 Console.Error.WriteLine(diagnostic.ToString());
18 }
19 }
20}
class BindingDiagnostic(WorkspaceDiagnosticKind kind, string message, Project project, Document? document)