提交 2e74460b 编写于 作者: A Allison Chou

Wrap better pt2

上级 9a0c9cf2
......@@ -103,9 +103,10 @@ internal partial class CSharpIntroduceVariableService
BlockSyntax newBody;
if (doesDelegateMethodReturnVoid)
{
// We don't need to include the rewritten body if it consists of just the identifier name. However, in all other cases,
// the rewritten body should be included.
var isRewrittenBodyTrivial = rewrittenBody.WalkDownParentheses().IsKind(SyntaxKind.IdentifierName, out IdentifierNameSyntax identifier) &&
// We don't need to include the rewritten body if it consists of just the identifier name.
// However, in all other cases, the rewritten body should be included.
var isRewrittenBodyTrivial = rewrittenBody.WalkDownParentheses().IsKind(SyntaxKind.IdentifierName,
out IdentifierNameSyntax identifier) &&
identifier.Identifier.ValueText == newLocalName.Identifier.ValueText;
if (isRewrittenBodyTrivial)
......@@ -115,7 +116,8 @@ internal partial class CSharpIntroduceVariableService
else
{
newBody = SyntaxFactory.Block(
declarationStatement, SyntaxFactory.ExpressionStatement(rewrittenBody, SyntaxFactory.Token(SyntaxKind.SemicolonToken)));
declarationStatement,
SyntaxFactory.ExpressionStatement(rewrittenBody, SyntaxFactory.Token(SyntaxKind.SemicolonToken)));
}
}
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册