提交 1031e1c4 编写于 作者: N Niko Schuessler

More CR comments.

上级 98630752
......@@ -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,
......
......@@ -113,13 +113,14 @@ private IEnumerable<string> 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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册