提交 e86ef1c1 编写于 作者: C CyrusNajmabadi

Simplify

上级 cc3c00b1
......@@ -174,7 +174,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
private ParameterListSyntax GenerateParenthesizedLambdaParameterList(
SemanticModel semanticModel, ParenthesizedLambdaExpressionSyntax lambdaExpression, CancellationToken cancellationToken)
{
var newParameterList = lambdaExpression.ParameterList.ReplaceNodes(
return lambdaExpression.ParameterList.ReplaceNodes(
lambdaExpression.ParameterList.Parameters,
(parameterNode, _) =>
{
......@@ -186,14 +186,6 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
var parameter = semanticModel.GetDeclaredSymbol(parameterNode, cancellationToken);
return parameterNode.WithType(parameter?.Type.GenerateTypeSyntax() ?? s_objectType);
});
//var sourceText = semanticModel.SyntaxTree.GetText(cancellationToken);
//if (sourceText.AreOnSameLine(lambdaExpression.ParameterList.CloseParenToken, lambdaExpression.ArrowToken))
//{
// newParameterList = newParameterList.WithAppendedTrailingTrivia(lambdaExpression.ArrowToken.TrailingTrivia);
//}
return newParameterList;
}
private class MyCodeAction : CodeAction.DocumentChangeAction
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册