Skip to main content

Document Class Extensions

Extension MethodSummary
InsertNodeAfterAsync(Document, SyntaxNode, SyntaxNode, CancellationToken)Creates a new document with a new node inserted after the specified node.
InsertNodeBeforeAsync(Document, SyntaxNode, SyntaxNode, CancellationToken)Creates a new document with a new node inserted before the specified node.
InsertNodesAfterAsync(Document, SyntaxNode, IEnumerable<SyntaxNode>, CancellationToken)Creates a new document with new nodes inserted after the specified node.
InsertNodesBeforeAsync(Document, SyntaxNode, IEnumerable<SyntaxNode>, CancellationToken)Creates a new document with new nodes inserted before the specified node.
RemoveCommentsAsync(Document, CommentFilter, CancellationToken)Creates a new document with comments of the specified kind removed.
RemoveCommentsAsync(Document, TextSpan, CommentFilter, CancellationToken)Creates a new document with comments of the specified kind removed.
RemoveNodeAsync(Document, SyntaxNode, SyntaxRemoveOptions, CancellationToken)Creates a new document with the specified node removed.
RemoveNodesAsync(Document, IEnumerable<SyntaxNode>, SyntaxRemoveOptions, CancellationToken)Creates a new document with the specified nodes removed.
RemovePreprocessorDirectivesAsync(Document, PreprocessorDirectiveFilter, CancellationToken)Creates a new document with preprocessor directives of the specified kind removed.
RemovePreprocessorDirectivesAsync(Document, TextSpan, PreprocessorDirectiveFilter, CancellationToken)Creates a new document with preprocessor directives of the specified kind removed.
RemoveRegionAsync(Document, RegionInfo, CancellationToken)Creates a new document with the specified region removed.
RemoveTriviaAsync(Document, TextSpan, CancellationToken)Creates a new document with trivia inside the specified span removed.
ReplaceMembersAsync(Document, MemberDeclarationListInfo, IEnumerable<MemberDeclarationSyntax>, CancellationToken)Creates a new document with the specified members replaced with new members.
ReplaceMembersAsync(Document, MemberDeclarationListInfo, SyntaxList<MemberDeclarationSyntax>, CancellationToken)Creates a new document with the specified members replaced with new members.
ReplaceModifiersAsync(Document, ModifierListInfo, IEnumerable<SyntaxToken>, CancellationToken)Creates a new document with the specified modifiers replaced with new modifiers.
ReplaceModifiersAsync(Document, ModifierListInfo, SyntaxTokenList, CancellationToken)Creates a new document with the specified modifiers replaced with new modifiers.
ReplaceNodeAsync(Document, SyntaxNode, IEnumerable<SyntaxNode>, CancellationToken)Creates a new document with the specified old node replaced with new nodes.
ReplaceNodeAsync(Document, SyntaxNode, SyntaxNode, CancellationToken)Creates a new document with the specified old node replaced with a new node.
ReplaceNodesAsync<TNode>(Document, IEnumerable<TNode>, Func<TNode, TNode, SyntaxNode>, CancellationToken)Creates a new document with the specified old nodes replaced with new nodes.
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.
ReplaceTokenAsync(Document, SyntaxToken, IEnumerable<SyntaxToken>, CancellationToken)Creates a new document with the specified old token replaced with new tokens.
ReplaceTokenAsync(Document, SyntaxToken, SyntaxToken, CancellationToken)Creates a new document with the specified old token replaced with a new token.
ReplaceTriviaAsync(Document, SyntaxTrivia, IEnumerable<SyntaxTrivia>, CancellationToken)Creates a new document with the specified old trivia replaced with a new trivia.
ReplaceTriviaAsync(Document, SyntaxTrivia, SyntaxTrivia, CancellationToken)Creates a new document with the specified old trivia replaced with a new trivia.
WithTextChangeAsync(Document, TextChange, CancellationToken)Creates a new document updated with the specified text change.
WithTextChangesAsync(Document, IEnumerable<TextChange>, CancellationToken)Creates a new document updated with the specified text changes.
WithTextChangesAsync(Document, TextChange[], CancellationToken)Creates a new document updated with the specified text changes.