From 4a11f46c6ff059b02e4804aad9e88b6812c296d0 Mon Sep 17 00:00:00 2001 From: peter-r-g Date: Fri, 9 Dec 2022 12:45:37 -0500 Subject: [PATCH] Fix button messages not updating on clear --- code/ProjectDiagnostics.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/ProjectDiagnostics.cs b/code/ProjectDiagnostics.cs index 1e3ac80..9429ed9 100644 --- a/code/ProjectDiagnostics.cs +++ b/code/ProjectDiagnostics.cs @@ -246,6 +246,10 @@ private void UpdateErrors( string projectName = null ) // Fast path if ( Diagnostics.Count == 0 || (!ShowInfo && !ShowWarnings && !ShowErrors) ) { + ErrorsButton.Text = "0 Errors"; + WarningsButton.Text = "0 Warnings"; + InfoButton.Text = "0 Messages"; + DiagnosticsView.SetItems( Array.Empty() ); DiagnosticsView.Hide(); EmptyErrorListLabel.Show(); @@ -254,9 +258,9 @@ private void UpdateErrors( string projectName = null ) var q = Diagnostics.Where( FilterDiagnostic ); - InfoButton.Text = $"{q.Count( x => x.Severity == ICSharpCompiler.DiagnosticSeverity.Info )} Messages"; - WarningsButton.Text = $"{q.Count( x => x.Severity == ICSharpCompiler.DiagnosticSeverity.Warning )} Warnings"; ErrorsButton.Text = $"{q.Count( x => x.Severity == ICSharpCompiler.DiagnosticSeverity.Error )} Errors"; + WarningsButton.Text = $"{q.Count( x => x.Severity == ICSharpCompiler.DiagnosticSeverity.Warning )} Warnings"; + InfoButton.Text = $"{q.Count( x => x.Severity == ICSharpCompiler.DiagnosticSeverity.Info )} Messages"; if ( !ShowInfo ) q = q.Where( x => x.Severity != ICSharpCompiler.DiagnosticSeverity.Info );