Aracılığıyla paylaş


SyntaxList<TNode> Struct

Definition

A list of SyntaxNode.

generic <typename TNode>
 where TNode : SyntaxNodepublic value class SyntaxList : IEquatable<Microsoft::CodeAnalysis::SyntaxList<TNode>>, System::Collections::Generic::IEnumerable<TNode>, System::Collections::Generic::IReadOnlyCollection<TNode>, System::Collections::Generic::IReadOnlyList<TNode>
public readonly struct SyntaxList<TNode> : IEquatable<Microsoft.CodeAnalysis.SyntaxList<TNode>>, System.Collections.Generic.IEnumerable<TNode>, System.Collections.Generic.IReadOnlyCollection<TNode>, System.Collections.Generic.IReadOnlyList<TNode> where TNode : SyntaxNode
type SyntaxList<'Node (requires 'Node :> SyntaxNode)> = struct
    interface IReadOnlyList<'Node (requires 'Node :> SyntaxNode)>
    interface seq<'Node (requires 'Node :> SyntaxNode)>
    interface IEnumerable
    interface IReadOnlyCollection<'Node (requires 'Node :> SyntaxNode)>
Public Structure SyntaxList(Of TNode)
Implements IEnumerable(Of TNode), IEquatable(Of SyntaxList(Of TNode)), IReadOnlyCollection(Of TNode), IReadOnlyList(Of TNode)

Type Parameters

TNode
Inheritance
SyntaxList<TNode>
Implements

Constructors

SyntaxList<TNode>(IEnumerable<TNode>)

Creates a list of syntax nodes.

SyntaxList<TNode>(TNode)

Creates a singleton list of syntax nodes.

Properties

Count

The number of nodes in the list.

FullSpan

The absolute span of the list elements in characters, including the leading and trailing trivia of the first and last elements.

Item[Int32]

Gets the node at the specified index.

Span

The absolute span of the list elements in characters, not including the leading and trailing trivia of the first and last elements.

Methods

Add(TNode)

Creates a new list with the specified node added at the end.

AddRange(IEnumerable<TNode>)

Creates a new list with the specified nodes added at the end.

Any()

True if the list has at least one node.

Equals(Object)
Equals(SyntaxList<TNode>)
First()

The first node in the list.

FirstOrDefault()

The first node in the list or default if the list is empty.

GetEnumerator()

Get's the enumerator for this list.

GetHashCode()
IndexOf(Func<TNode,Boolean>)
IndexOf(TNode)

The index of the node in this list, or -1 if the node is not in the list.

Insert(Int32, TNode)

Creates a new list with the specified node inserted at the index.

InsertRange(Int32, IEnumerable<TNode>)

Creates a new list with the specified nodes inserted at the index.

Last()

The last node in the list.

LastIndexOf(Func<TNode,Boolean>)
LastIndexOf(TNode)
LastOrDefault()

The last node in the list or default if the list is empty.

Remove(TNode)

Creates a new list with the element removed.

RemoveAt(Int32)

Creates a new list with the element at specified index removed.

Replace(TNode, TNode)

Creates a new list with the specified element replaced with the new node.

ReplaceRange(TNode, IEnumerable<TNode>)

Creates a new list with the specified element replaced with new nodes.

ToFullString()

Returns the full string representation of the nodes in this list including the first node's leading trivia and the last node's trailing trivia.

ToString()

Returns the string representation of the nodes in this list, not including the first node's leading trivia and the last node's trailing trivia.

Operators

Equality(SyntaxList<TNode>, SyntaxList<TNode>)
Explicit(SyntaxList<SyntaxNode> to SyntaxList<TNode>)
Implicit(SyntaxList<SyntaxNode> to SyntaxList<TNode>)
Implicit(SyntaxList<TNode> to SyntaxList<SyntaxNode>)
Inequality(SyntaxList<TNode>, SyntaxList<TNode>)

Explicit Interface Implementations

IEnumerable.GetEnumerator()
IEnumerable<TNode>.GetEnumerator()

Extension Methods

Any<TNode>(SyntaxList<TNode>, SyntaxKind)

True if the list has at least one node of the specified kind.

IndexOf<TNode>(SyntaxList<TNode>, SyntaxKind)

Returns the index of the first node of a specified kind in the node list.

Any<TNode>(SyntaxList<TNode>, SyntaxKind)

Tests whether a list contains node of a particular kind.

IndexOf<TNode>(SyntaxList<TNode>, SyntaxKind)

Returns the index of the first node of a specified kind in the node list.

Applies to