Delen via


SyntaxNodeExtensions Class

Definition

public ref class SyntaxNodeExtensions abstract sealed
public static class SyntaxNodeExtensions
type SyntaxNodeExtensions = class
Public Module SyntaxNodeExtensions
Inheritance
SyntaxNodeExtensions

Methods

GetCurrentNode<TNode>(SyntaxNode, TNode)

Gets the node within the subtree corresponding to the original tracked node. Use TrackNodes to start tracking nodes.

GetCurrentNodes<TNode>(SyntaxNode, IEnumerable<TNode>)

Gets the nodes within the subtree corresponding to the original tracked nodes. Use TrackNodes to start tracking nodes.

GetCurrentNodes<TNode>(SyntaxNode, TNode)

Gets the nodes within the subtree corresponding to the original tracked node. Use TrackNodes to start tracking nodes.

InsertNodesAfter<TRoot>(TRoot, SyntaxNode, IEnumerable<SyntaxNode>)

Creates a new tree of nodes with new nodes inserted after the specified node.

InsertNodesBefore<TRoot>(TRoot, SyntaxNode, IEnumerable<SyntaxNode>)

Creates a new tree of nodes with new nodes inserted before the specified node.

InsertTokensAfter<TRoot>(TRoot, SyntaxToken, IEnumerable<SyntaxToken>)

Creates a new tree of nodes with new tokens inserted after the specified token.

InsertTokensBefore<TRoot>(TRoot, SyntaxToken, IEnumerable<SyntaxToken>)

Creates a new tree of nodes with new tokens inserted before the specified token.

InsertTriviaAfter<TRoot>(TRoot, SyntaxTrivia, IEnumerable<SyntaxTrivia>)

Creates a new tree of nodes with new trivia inserted after the specified trivia.

InsertTriviaBefore<TRoot>(TRoot, SyntaxTrivia, IEnumerable<SyntaxTrivia>)

Creates a new tree of nodes with new trivia inserted before the specified trivia.

NormalizeWhitespace<TNode>(TNode, String, Boolean)

Creates a new syntax node with all whitespace and end of line trivia replaced with regularly formatted trivia.

NormalizeWhitespace<TNode>(TNode, String, String, Boolean)

Creates a new syntax node with all whitespace and end of line trivia replaced with regularly formatted trivia.

RemoveNode<TRoot>(TRoot, SyntaxNode, SyntaxRemoveOptions)

Creates a new tree of nodes with the specified node removed.

RemoveNodes<TRoot>(TRoot, IEnumerable<SyntaxNode>, SyntaxRemoveOptions)

Creates a new tree of nodes with the specified nodes removed.

ReplaceNode<TRoot>(TRoot, SyntaxNode, IEnumerable<SyntaxNode>)

Creates a new tree of nodes with specified old node replaced with a new nodes.

ReplaceNode<TRoot>(TRoot, SyntaxNode, SyntaxNode)

Creates a new tree of nodes with the specified old node replaced with a new node.

ReplaceNodes<TRoot,TNode>(TRoot, IEnumerable<TNode>, Func<TNode,TNode,SyntaxNode>)

Creates a new tree of nodes with the specified old node replaced with a new node.

ReplaceSyntax<TRoot>(TRoot, IEnumerable<SyntaxNode>, Func<SyntaxNode, SyntaxNode,SyntaxNode>, IEnumerable<SyntaxToken>, Func<SyntaxToken, SyntaxToken,SyntaxToken>, IEnumerable<SyntaxTrivia>, Func<SyntaxTrivia, SyntaxTrivia,SyntaxTrivia>)

Creates a new tree of nodes with the specified nodes, tokens and trivia replaced.

ReplaceToken<TRoot>(TRoot, SyntaxToken, IEnumerable<SyntaxToken>)

Creates a new tree of nodes with the specified old token replaced with new tokens.

ReplaceToken<TRoot>(TRoot, SyntaxToken, SyntaxToken)

Creates a new tree of nodes with the specified old token replaced with a new token.

ReplaceTokens<TRoot>(TRoot, IEnumerable<SyntaxToken>, Func<SyntaxToken,SyntaxToken,SyntaxToken>)

Creates a new tree of nodes with the specified old node replaced with a new node.

ReplaceTrivia<TRoot>(TRoot, IEnumerable<SyntaxTrivia>, Func<SyntaxTrivia,SyntaxTrivia,SyntaxTrivia>)

Creates a new tree of nodes with the specified trivia replaced with new trivia.

ReplaceTrivia<TRoot>(TRoot, SyntaxTrivia, IEnumerable<SyntaxTrivia>)

Creates a new tree of nodes with the specified old trivia replaced with new trivia.

ReplaceTrivia<TRoot>(TRoot, SyntaxTrivia, SyntaxTrivia)

Creates a new tree of nodes with the specified trivia replaced with new trivia.

TrackNodes<TRoot>(TRoot, IEnumerable<SyntaxNode>)

Creates a new tree of nodes with the specified nodes being tracked.

Use GetCurrentNode on the subtree resulting from this operation, or any transformation of it, to get the current node corresponding to the original tracked node.

TrackNodes<TRoot>(TRoot, SyntaxNode[])

Creates a new tree of nodes with the specified nodes being tracked.

Use GetCurrentNode on the subtree resulting from this operation, or any transformation of it, to get the current node corresponding to the original tracked node.

WithLeadingTrivia<TSyntax>(TSyntax, IEnumerable<SyntaxTrivia>)

Creates a new node from this node with the leading trivia replaced.

WithLeadingTrivia<TSyntax>(TSyntax, SyntaxTrivia[])

Creates a new node from this node with the leading trivia replaced.

WithLeadingTrivia<TSyntax>(TSyntax, SyntaxTriviaList)

Creates a new node from this node with the leading trivia replaced.

WithoutLeadingTrivia<TSyntax>(TSyntax)

Creates a new node from this node with the leading trivia removed.

WithoutTrailingTrivia<TSyntax>(TSyntax)

Creates a new node from this node with the trailing trivia removed.

WithoutTrivia(SyntaxToken)

Creates a new token from this token without leading or trailing trivia.

WithoutTrivia<TSyntax>(TSyntax)

Creates a new node from this node without leading or trailing trivia.

WithTrailingTrivia<TSyntax>(TSyntax, IEnumerable<SyntaxTrivia>)

Creates a new node from this node with the trailing trivia replaced.

WithTrailingTrivia<TSyntax>(TSyntax, SyntaxTrivia[])

Creates a new node from this node with the trailing trivia replaced.

WithTrailingTrivia<TSyntax>(TSyntax, SyntaxTriviaList)

Creates a new node from this node with the trailing trivia replaced.

WithTriviaFrom<TSyntax>(TSyntax, SyntaxNode)

Creates a new node from this node with both the leading and trailing trivia of the specified node.

Applies to