Skip to main content

SyntaxList<TNode> Struct Extensions

Extension MethodSummary
Add(SyntaxList<StatementSyntax>, StatementSyntax, Boolean)Creates a new list with the specified node added or inserted.
All<TNode>(SyntaxList<TNode>, Func<TNode, Boolean>)Returns true if all nodes in a list matches the predicate.
Any<TNode>(SyntaxList<TNode>, Func<TNode, Boolean>)Returns true if any node in a list matches the predicate.
Contains<TNode>(SyntaxList<TNode>, SyntaxKind)Returns true if a node of the specified kind is in the SyntaxList<TNode>.
Contains<TNode>(SyntaxList<TNode>, TNode)Returns true if the specified node is in the SyntaxList<TNode>.
DescendantTrivia<TNode>(SyntaxList<TNode>, Func<SyntaxNode, Boolean>, Boolean)Get a list of all the trivia associated with the nodes in the list.
DescendantTrivia<TNode>(SyntaxList<TNode>, TextSpan, Func<SyntaxNode, Boolean>, Boolean)Get a list of all the trivia associated with the nodes in the list.
Find<TNode>(SyntaxList<TNode>, SyntaxKind)Searches for a node of the specified kind and returns the first occurrence within the entire SyntaxList<TNode>.
IsFirst<TNode>(SyntaxList<TNode>, TNode)Returns true if the specified node is a first node in the list.
IsLast(SyntaxList<StatementSyntax>, StatementSyntax, Boolean)Returns true if the specified statement is a last statement in the list.
IsLast<TNode>(SyntaxList<TNode>, TNode)Returns true if the specified node is a last node in the list.
LastIndexOf<TNode>(SyntaxList<TNode>, SyntaxKind)Searches for a node of the specified kind and returns the zero-based index of the last occurrence within the entire SyntaxList<TNode>.
RemoveRange<TNode>(SyntaxList<TNode>, Int32, Int32)Creates a new list with elements in the specified range removed.
ReplaceAt<TNode>(SyntaxList<TNode>, Int32, TNode)Creates a new list with the node at the specified index replaced with a new node.
ReplaceRange<TNode>(SyntaxList<TNode>, Int32, Int32, IEnumerable<TNode>)Creates a new list with the elements in the specified range replaced with new nodes.
ReplaceRange<TNode>(SyntaxList<TNode>, Int32, Int32, TNode)Creates a new list with the elements in the specified range replaced with new node.
TrimTrivia<TNode>(SyntaxList<TNode>)Removes all leading whitespace from the leading trivia of the first node in a list and all trailing whitespace from the trailing trivia of the last node in a list and returns a new list with the new trivia. SyntaxKind.WhitespaceTrivia and SyntaxKind.EndOfLineTrivia is considered to be a whitespace.
WithTriviaFrom<TNode>(SyntaxList<TNode>, SyntaxNode)Creates a new list with both leading and trailing trivia of the specified node. If the list contains more than one item, first item is updated with leading trivia and last item is updated with trailing trivia.