Skip to content

Commit 0953f9d

Browse files
committed
Merge pull request #6435 from mavasani/Issue6425
Right click "Suppress" should be enabled even when the error list selection has some suppressed issues
2 parents f96c8b9 + 6feab1f commit 0953f9d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/VisualStudio/Core/Def/Implementation/TableDataSource/Suppression/VisualStudioDiagnosticListSuppressionStateService.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,18 @@ public VisualStudioDiagnosticListSuppressionStateService(
5454
// If we can suppress either in source or in suppression file, we enable suppress context menu.
5555
public bool CanSuppressSelectedEntries => CanSuppressSelectedEntriesInSource || CanSuppressSelectedEntriesInSuppressionFiles;
5656

57-
// If only suppressed items are selected, we enable remove suppressions.
58-
public bool CanRemoveSuppressionsSelectedEntries => _selectedActiveItems == 0 && _selectedSuppressedItems > 0;
57+
// If at least one suppressed item is selected, we enable remove suppressions.
58+
public bool CanRemoveSuppressionsSelectedEntries => _selectedSuppressedItems > 0;
5959

60-
// If only Roslyn active items are selected, we enable suppress in source.
60+
// If at least one Roslyn active item with location is selected, we enable suppress in source.
61+
// Note that we do not support suppress in source when mix of Roslyn and non-Roslyn items are selected as in-source suppression has different meaning and implementation for these.
6162
public bool CanSuppressSelectedEntriesInSource => _selectedActiveItems > 0 &&
62-
_selectedSuppressedItems == 0 &&
6363
_selectedRoslynItems == _selectedActiveItems &&
6464
(_selectedRoslynItems - _selectedNoLocationDiagnosticItems) > 0;
6565

66-
// If only active items are selected, and there is at least one Roslyn item, we enable suppress in suppression file.
66+
// If at least one Roslyn active item is selected, we enable suppress in suppression file.
6767
// Also, compiler diagnostics cannot be suppressed in suppression file, so there must be at least one non-compiler item.
6868
public bool CanSuppressSelectedEntriesInSuppressionFiles => _selectedActiveItems > 0 &&
69-
_selectedSuppressedItems == 0 &&
7069
(_selectedRoslynItems - _selectedCompilerDiagnosticItems) > 0;
7170

7271
private void ClearState()

0 commit comments

Comments
 (0)