Use AttributeData for [D2DCompileOptions] assembly diagnostics

このコミットが含まれているのは:
Sergio Pedri committed 2022-05-27 18:37:35 +02:00
1 親 77acc47c5b
コミット f49831567e
2ファイル変更
+16 -54

検索条件に一致するファイルはありません

+4 -1
ファイルの表示
@@ -117,7 +117,10 @@ public sealed partial class ID2D1ShaderGenerator : IIncrementalGenerator
context.ReportDiagnostics(shaderInfoWithErrors.Select(static (item, token) => item.Diagnostics));
// Get all errors for invalid [D2D1CompileOptions] attributes added to the assembly level
IncrementalValuesProvider<Diagnostic> d2DCompileOptionsAtAssemblyLevelErrors = LoadBytecode.GetAssemblyLevelCompileOptionsDiagnostics(context.SyntaxProvider);
IncrementalValuesProvider<Diagnostic> d2DCompileOptionsAtAssemblyLevelErrors =
context.CompilationProvider
.SelectMany(static (compilation, token) => ImmutableArray.Create(LoadBytecode.GetAssemblyLevelCompileOptionsDiagnostics(compilation.Assembly, token)))
.Where(static item => item is not null)!;
// Output the diagnostics
context.ReportDiagnostics(d2DCompileOptionsAtAssemblyLevelErrors.Select(static (item, token) => item));