Skip to main content

WorkspaceExtensions.ReplaceNodesAsync Method

Containing Type: WorkspaceExtensions

Assembly: Roslynator.Workspaces.Core.dll

Overloads

MethodSummary
ReplaceNodesAsync<TNode>(Document, IEnumerable<TNode>, Func<TNode, TNode, SyntaxNode>, CancellationToken)Creates a new document with the specified old nodes replaced with new nodes.
ReplaceNodesAsync<TNode>(Solution, IEnumerable<TNode>, Func<TNode, TNode, SyntaxNode>, CancellationToken)Creates a new solution with the specified old nodes replaced with new nodes.

ReplaceNodesAsync<TNode>(Document, IEnumerable<TNode>, Func<TNode, TNode, SyntaxNode>, CancellationToken)

Creates a new document with the specified old nodes replaced with new nodes.

public static System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Document> ReplaceNodesAsync<TNode>(this Microsoft.CodeAnalysis.Document document, System.Collections.Generic.IEnumerable<TNode> nodes, Func<TNode, TNode, Microsoft.CodeAnalysis.SyntaxNode> computeReplacementNode, System.Threading.CancellationToken cancellationToken = default) where TNode : Microsoft.CodeAnalysis.SyntaxNode

Type Parameters

TNode

Parameters

document Document

nodes IEnumerable<TNode>

computeReplacementNode Func<TNode, TNode, SyntaxNode>

cancellationToken CancellationToken

Returns

Task<Document>

ReplaceNodesAsync<TNode>(Solution, IEnumerable<TNode>, Func<TNode, TNode, SyntaxNode>, CancellationToken)

Creates a new solution with the specified old nodes replaced with new nodes.

public static System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Solution> ReplaceNodesAsync<TNode>(this Microsoft.CodeAnalysis.Solution solution, System.Collections.Generic.IEnumerable<TNode> nodes, Func<TNode, TNode, Microsoft.CodeAnalysis.SyntaxNode> computeReplacementNodes, System.Threading.CancellationToken cancellationToken = default) where TNode : Microsoft.CodeAnalysis.SyntaxNode

Type Parameters

TNode

Parameters

solution Solution

nodes IEnumerable<TNode>

computeReplacementNodes Func<TNode, TNode, SyntaxNode>

cancellationToken CancellationToken

Returns

Task<Solution>