Skip to content

Commit

Permalink
Fix button messages not updating on clear
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-r-g committed Dec 9, 2022
1 parent 3a34c6b commit 4a11f46
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/ProjectDiagnostics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<object>() );
DiagnosticsView.Hide();
EmptyErrorListLabel.Show();
Expand All @@ -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 );
Expand Down

0 comments on commit 4a11f46

Please sign in to comment.