예제 #1
0
        private static Task <Document> RefactorAsync(Document document, SimpleLambdaExpressionSyntax lambda, SemanticModel semanticModel, CancellationToken cancellationToken)
        {
            SimpleLambdaExpressionSyntax newNode = AwaitRemover.Visit(lambda, semanticModel, cancellationToken);

            newNode = newNode.WithAsyncKeyword(GetMissingAsyncKeyword(lambda.AsyncKeyword));

            return(document.ReplaceNodeAsync(lambda, newNode, cancellationToken));
        }
 private SyntaxNode FixSimpleLambda(SimpleLambdaExpressionSyntax lambda)
 {
     return(lambda.WithAsyncKeyword(default(SyntaxToken)).WithPrependedLeadingTrivia(lambda.AsyncKeyword.LeadingTrivia));
 }