private async Task<Document> MakeTaskYieldReturnStatements(Document document, YieldStatementSyntax yieldStatement, CancellationToken ct) { var root = await document.GetSyntaxRootAsync(ct).ConfigureAwait(false); var semanticModel = await document.GetSemanticModelAsync(ct); var nodes = yieldStatement.CreateFixedYieldReturn(semanticModel); root = root.ReplaceNode(yieldStatement, nodes); return document.WithSyntaxRoot(root); }
private async Task <Document> MakeTaskYieldReturnStatements(Document document, YieldStatementSyntax yieldStatement, CancellationToken ct) { var root = await document.GetSyntaxRootAsync(ct).ConfigureAwait(false); var semanticModel = await document.GetSemanticModelAsync(ct); var nodes = yieldStatement.CreateFixedYieldReturn(semanticModel); root = root.ReplaceNode(yieldStatement, nodes); return(document.WithSyntaxRoot(root)); }