From 526ef7f9e8dc0580f02f1524a7cfc20a9521f350 Mon Sep 17 00:00:00 2001 From: Chris Sienkiewicz Date: Tue, 23 Jul 2024 11:39:05 -0700 Subject: [PATCH] Don't try and add the result diagnostics if they are default or empty --- .../SolutionCompilationState.RegularCompilationTracker.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.RegularCompilationTracker.cs b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.RegularCompilationTracker.cs index e2917700d9427..3943b8ce6beba 100644 --- a/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.RegularCompilationTracker.cs +++ b/src/Workspaces/Core/Portable/Workspace/Solution/SolutionCompilationState.RegularCompilationTracker.cs @@ -872,7 +872,7 @@ public async ValueTask> GetSourceGeneratorDiagnostics foreach (var result in driverRunResult.Results) { - if (!IsGeneratorRunResultToIgnore(result)) + if (!result.Diagnostics.IsDefaultOrEmpty && !IsGeneratorRunResultToIgnore(result)) { builder.AddRange(result.Diagnostics); }