Skip to main content

WorkspaceExtensions.ReplaceStatementsAsync Method

Containing Type: WorkspaceExtensions

Assembly: Roslynator.CSharp.Workspaces.dll

Overloads

MethodSummary
ReplaceStatementsAsync(Document, StatementListInfo, IEnumerable<StatementSyntax>, CancellationToken)Creates a new document with the specified statements replaced with new statements.
ReplaceStatementsAsync(Document, StatementListInfo, SyntaxList<StatementSyntax>, CancellationToken)Creates a new document with the specified statements replaced with new statements.

ReplaceStatementsAsync(Document, StatementListInfo, IEnumerable<StatementSyntax>, CancellationToken)

Creates a new document with the specified statements replaced with new statements.

public static System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Document> ReplaceStatementsAsync(this Microsoft.CodeAnalysis.Document document, Roslynator.CSharp.Syntax.StatementListInfo statementsInfo, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax> newStatements, System.Threading.CancellationToken cancellationToken = default)

Parameters

document Document

statementsInfo StatementListInfo

newStatements IEnumerable<StatementSyntax>

cancellationToken CancellationToken

Returns

Task<Document>

ReplaceStatementsAsync(Document, StatementListInfo, SyntaxList<StatementSyntax>, CancellationToken)

Creates a new document with the specified statements replaced with new statements.

public static System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Document> ReplaceStatementsAsync(this Microsoft.CodeAnalysis.Document document, Roslynator.CSharp.Syntax.StatementListInfo statementsInfo, Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.StatementSyntax> newStatements, System.Threading.CancellationToken cancellationToken = default)

Parameters

document Document

statementsInfo StatementListInfo

newStatements SyntaxList<StatementSyntax>

cancellationToken CancellationToken

Returns

Task<Document>