未验证 提交 26610169 编写于 作者: J Julien Couvreur 提交者: GitHub

NormalizeWhitespace: don't add space after colon in interpolation format clause (#24494)

上级 450cfb53
......@@ -385,7 +385,7 @@ private static bool NeedsSeparator(SyntaxToken token, SyntaxToken next)
if (token.IsKind(SyntaxKind.ColonToken))
{
return true;
return !token.Parent.IsKind(SyntaxKind.InterpolationFormatClause);
}
if (next.IsKind(SyntaxKind.ColonToken))
......
......@@ -274,6 +274,14 @@ public void TestSpacingOnInvocationLikeKeywords()
TestNormalizeExpression("__arglist (a)", "__arglist(a)");
}
[Fact]
[WorkItem(24454, "https://github.com/dotnet/roslyn/issues/24454")]
public void TestSpacingOnInterpolatedString()
{
TestNormalizeExpression("$\"{3:C}\"", "$\"{3:C}\"");
TestNormalizeExpression("$\"{3: C}\"", "$\"{3: C}\"");
}
[Fact]
[WorkItem(23618, "https://github.com/dotnet/roslyn/issues/23618")]
public void TestSpacingOnMethodConstraint()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册