diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/DiagnosticAnalyzerDriver/DiagnosticAnalyzerDriverTests.cs b/src/EditorFeatures/CSharpTest/Diagnostics/DiagnosticAnalyzerDriver/DiagnosticAnalyzerDriverTests.cs index 218d4cefc70fb395180367e55917a8101c21e64d..87c98f8980ca8960f0cf93600f5b115f5b9b223c 100644 --- a/src/EditorFeatures/CSharpTest/Diagnostics/DiagnosticAnalyzerDriver/DiagnosticAnalyzerDriverTests.cs +++ b/src/EditorFeatures/CSharpTest/Diagnostics/DiagnosticAnalyzerDriver/DiagnosticAnalyzerDriverTests.cs @@ -679,7 +679,7 @@ public async Task TestNuGetAndVsixAnalyzer_SuppressorSuppressesVsixAnalyzer() // 1) No duplicate diagnostics // 2) Both NuGet and Vsix analyzers execute // 3) Only Nuget suppressor executes - // 4) Appropriate diagnostic filtering is done - Nuget suppressor uppresses VSIX analyzer. + // 4) Appropriate diagnostic filtering is done - Nuget suppressor suppresses VSIX analyzer. await TestNuGetAndVsixAnalyzerCoreAsync( nugetAnalyzers: ImmutableArray.Create(firstNugetAnalyzer), expectedNugetAnalyzersExecuted: true, diff --git a/src/Test/Utilities/Portable/Diagnostics/DiagnosticDescription.cs b/src/Test/Utilities/Portable/Diagnostics/DiagnosticDescription.cs index cd2db7afb238e36a526eb605513879cd1fb9bd58..02e7030dfa1d862419e4d03b841cc286ce9e308b 100644 --- a/src/Test/Utilities/Portable/Diagnostics/DiagnosticDescription.cs +++ b/src/Test/Utilities/Portable/Diagnostics/DiagnosticDescription.cs @@ -113,13 +113,14 @@ private IEnumerable GetArgumentsAsStrings() _isSuppressed = isSuppressed; } - public DiagnosticDescription(Diagnostic d, bool errorCodeOnly, bool includeDefaultSeverity = false, bool includeEffectiveSeverity = false) + public DiagnosticDescription(Diagnostic d, bool errorCodeOnly, bool includeDefaultSeverity = false, bool includeEffectiveSeverity = false, bool isSuppressed = false) { _code = d.Code; _isWarningAsError = d.IsWarningAsError; _location = d.Location; _defaultSeverityOpt = includeDefaultSeverity ? d.DefaultSeverity : (DiagnosticSeverity?)null; _effectiveSeverityOpt = includeEffectiveSeverity ? d.Severity : (DiagnosticSeverity?)null; + _isSuppressed = isSuppressed; DiagnosticWithInfo dinfo = null; if (d.Code == 0 || d.Descriptor.CustomTags.Contains(WellKnownDiagnosticTags.CustomObsolete)) @@ -240,6 +241,9 @@ public override bool Equals(object obj) if (_isWarningAsError != d._isWarningAsError) return false; + if (_isSuppressed != d._isSuppressed) + return false; + if (!_ignoreArgumentsWhenComparing) { if (_squiggledText != d._squiggledText) @@ -328,6 +332,7 @@ public override int GetHashCode() int hashCode; hashCode = _code.GetHashCode(); hashCode = Hash.Combine(_isWarningAsError.GetHashCode(), hashCode); + hashCode = Hash.Combine(_isSuppressed.GetHashCode(), hashCode); // TODO: !!! This implementation isn't consistent with Equals, which might ignore inequality of some members based on ignoreArgumentsWhenComparing flag, etc. hashCode = Hash.Combine(_squiggledText, hashCode); @@ -373,6 +378,9 @@ public override string ToString() sb.Append('"'); } + sb.Append(", isSuppressed: "); + sb.Append(_isSuppressed ? "true" : "false"); + sb.Append(")"); if (_arguments != null)