提交 a6713597 编写于 作者: C Cyrus Najmabadi

Simplify

上级 bf149afa
......@@ -445,9 +445,9 @@ protected Task TestSmartTagGlyphTagsAsync(string initialMarkup, ImmutableArray<s
string diagnosticTag,
string markupKey,
string initialMarkupWithoutSpans,
List<Diagnostic> diagnosticsWithTag)
ImmutableArray<Diagnostic> diagnosticsWithTag)
{
var message = $"Expected {expectedSpans.Length} diagnostic spans with custom tag '{diagnosticTag}', but there were {diagnosticsWithTag.Count}.";
var message = $"Expected {expectedSpans.Length} diagnostic spans with custom tag '{diagnosticTag}', but there were {diagnosticsWithTag.Length}.";
if (expectedSpans.Length == 0)
{
......
......@@ -89,11 +89,11 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
(TInterpolationAlignmentClause)generator.InterpolationAlignmentClause(alignment));
}
if (formatString != null)
if (!string.IsNullOrEmpty(formatString))
{
result = WithFormatClause(result, formatString == ""
? null
: (TInterpolationFormatClause?)generator.InterpolationFormatClause(Escape(interpolatedString, formatString)));
result = WithFormatClause(
result,
(TInterpolationFormatClause?)generator.InterpolationFormatClause(Escape(interpolatedString, formatString)));
}
return result;
......
......@@ -85,6 +85,8 @@ private static IOperation Unwrap(IOperation expression)
if (invocation.Arguments.Length == 0)
{
// A call to `.ToString()` at the end of the interpolation. This is unnecessary.
// Just remove entirely.
unwrapped = invocation.Instance;
formatString = "";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册