Search Results for

    Show / Hide Table of Contents

    Struct SeparatedSyntaxList<TNode>

    Represents a list of nodes separated by one token. May have a trailing node.

    Implements
    IEquatable<SeparatedSyntaxList<TNode>>
    IReadOnlyList<TNode>
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Loretta.CodeAnalysis
    Assembly: Loretta.CodeAnalysis.dll
    Syntax
    public readonly struct SeparatedSyntaxList<TNode>
        where TNode : SyntaxNode
    Type Parameters
    Name Description
    TNode

    Properties

    | Improve this Doc View Source

    Count

    The amount of nodes contained in this list.

    Declaration
    public readonly int Count { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    FullSpan

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

    Declaration
    public readonly TextSpan FullSpan { get; }
    Property Value
    Type Description
    TextSpan
    | Improve this Doc View Source

    Item[Int32]

    Obtains a node from this list at the provided index.

    Declaration
    public readonly TNode this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    TNode
    | Improve this Doc View Source

    SeparatorCount

    The amount of separators contained in this list.

    Declaration
    public readonly int SeparatorCount { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Span

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

    Declaration
    public readonly TextSpan Span { get; }
    Property Value
    Type Description
    TextSpan

    Methods

    | Improve this Doc View Source

    Add(TNode)

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

    Declaration
    public readonly SeparatedSyntaxList<TNode> Add(TNode node)
    Parameters
    Type Name Description
    TNode node

    The node to add.

    Returns
    Type Description
    SeparatedSyntaxList<TNode>
    | Improve this Doc View Source

    AddRange(IEnumerable<TNode>)

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

    Declaration
    public readonly SeparatedSyntaxList<TNode> AddRange(IEnumerable<TNode> nodes)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<TNode> nodes

    The nodes to add.

    Returns
    Type Description
    SeparatedSyntaxList<TNode>
    | Improve this Doc View Source

    Any()

    Returns whether this list contains any elements.

    Declaration
    public readonly bool Any()
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Contains(TNode)

    Returns whether this list contains the provided node.

    Declaration
    public readonly bool Contains(TNode node)
    Parameters
    Type Name Description
    TNode node
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Equals(SeparatedSyntaxList<TNode>)

    Declaration
    public readonly bool Equals(SeparatedSyntaxList<TNode> other)
    Parameters
    Type Name Description
    SeparatedSyntaxList<TNode> other
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override readonly bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.ValueType.Equals(System.Object)
    | Improve this Doc View Source

    First()

    Returns the first node in this list.

    Declaration
    public readonly TNode First()
    Returns
    Type Description
    TNode
    | Improve this Doc View Source

    FirstOrDefault()

    Returns the first node in this list if any, otherwise returns the default value for the type of node.

    Declaration
    public readonly TNode FirstOrDefault()
    Returns
    Type Description
    TNode
    | Improve this Doc View Source

    GetEnumerator()

    Returns the enumerator for this list.

    Declaration
    public readonly SeparatedSyntaxList<TNode>.Enumerator GetEnumerator()
    Returns
    Type Description
    SeparatedSyntaxList.Enumerator<>
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override readonly int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()
    | Improve this Doc View Source

    GetSeparator(Int32)

    Gets the separator at the given index in this list.

    Declaration
    public readonly SyntaxToken GetSeparator(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The index.

    Returns
    Type Description
    SyntaxToken
    | Improve this Doc View Source

    GetSeparators()

    Returns the sequence of just the separator tokens.

    Declaration
    public readonly IEnumerable<SyntaxToken> GetSeparators()
    Returns
    Type Description
    System.Collections.IEnumerable<SyntaxToken>
    | Improve this Doc View Source

    GetWithSeparators()

    Returns the entire list including the separators.

    Declaration
    public readonly SyntaxNodeOrTokenList GetWithSeparators()
    Returns
    Type Description
    SyntaxNodeOrTokenList
    | Improve this Doc View Source

    IndexOf(TNode)

    Returns the index of the provided node in this list.

    Declaration
    public readonly int IndexOf(TNode node)
    Parameters
    Type Name Description
    TNode node
    Returns
    Type Description
    System.Int32

    -1 if the node was not found.

    | Improve this Doc View Source

    IndexOf(Func<TNode, Boolean>)

    Returns the index of the first node that passes the provided predicate in this list.

    Declaration
    public readonly int IndexOf(Func<TNode, bool> predicate)
    Parameters
    Type Name Description
    Func<TNode, System.Boolean> predicate
    Returns
    Type Description
    System.Int32

    -1 if not found.

    | Improve this Doc View Source

    Insert(Int32, TNode)

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

    Declaration
    public readonly SeparatedSyntaxList<TNode> Insert(int index, TNode node)
    Parameters
    Type Name Description
    System.Int32 index

    The index to insert at.

    TNode node

    The node to insert.

    Returns
    Type Description
    SeparatedSyntaxList<TNode>
    | Improve this Doc View Source

    InsertRange(Int32, IEnumerable<TNode>)

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

    Declaration
    public readonly SeparatedSyntaxList<TNode> InsertRange(int index, IEnumerable<TNode> nodes)
    Parameters
    Type Name Description
    System.Int32 index

    The index to insert at.

    System.Collections.IEnumerable<TNode> nodes

    The nodes to insert.

    Returns
    Type Description
    SeparatedSyntaxList<TNode>
    | Improve this Doc View Source

    Last()

    Returns the last element in this list.

    Declaration
    public readonly TNode Last()
    Returns
    Type Description
    TNode
    | Improve this Doc View Source

    LastIndexOf(TNode)

    Returns the index of the last node that is equal to the provided one.

    Declaration
    public readonly int LastIndexOf(TNode node)
    Parameters
    Type Name Description
    TNode node
    Returns
    Type Description
    System.Int32

    -1 if not found.

    | Improve this Doc View Source

    LastIndexOf(Func<TNode, Boolean>)

    Returns the index of the last node that passes the provided predicate in this list.

    Declaration
    public readonly int LastIndexOf(Func<TNode, bool> predicate)
    Parameters
    Type Name Description
    Func<TNode, System.Boolean> predicate
    Returns
    Type Description
    System.Int32

    -1 if not found.

    | Improve this Doc View Source

    LastOrDefault()

    Returns the last element in this list if any, otherwise returns the default value for the node type.

    Declaration
    public readonly TNode LastOrDefault()
    Returns
    Type Description
    TNode
    | Improve this Doc View Source

    Remove(TNode)

    Creates a new list with specified element removed.

    Declaration
    public readonly SeparatedSyntaxList<TNode> Remove(TNode node)
    Parameters
    Type Name Description
    TNode node

    The element to remove.

    Returns
    Type Description
    SeparatedSyntaxList<TNode>
    | Improve this Doc View Source

    RemoveAt(Int32)

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

    Declaration
    public readonly SeparatedSyntaxList<TNode> RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The index of the element to remove.

    Returns
    Type Description
    SeparatedSyntaxList<TNode>
    | Improve this Doc View Source

    Replace(TNode, TNode)

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

    Declaration
    public readonly SeparatedSyntaxList<TNode> Replace(TNode nodeInList, TNode newNode)
    Parameters
    Type Name Description
    TNode nodeInList

    The element to replace.

    TNode newNode

    The new node.

    Returns
    Type Description
    SeparatedSyntaxList<TNode>
    | Improve this Doc View Source

    ReplaceRange(TNode, IEnumerable<TNode>)

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

    Declaration
    public readonly SeparatedSyntaxList<TNode> ReplaceRange(TNode nodeInList, IEnumerable<TNode> newNodes)
    Parameters
    Type Name Description
    TNode nodeInList

    The element to replace.

    System.Collections.IEnumerable<TNode> newNodes

    The new nodes.

    Returns
    Type Description
    SeparatedSyntaxList<TNode>
    | Improve this Doc View Source

    ReplaceSeparator(SyntaxToken, SyntaxToken)

    Creates a new list with the specified separator token replaced with the new separator.

    Declaration
    public readonly SeparatedSyntaxList<TNode> ReplaceSeparator(SyntaxToken separatorToken, SyntaxToken newSeparator)
    Parameters
    Type Name Description
    SyntaxToken separatorToken

    The separator token to be replaced.

    SyntaxToken newSeparator

    The new separator token.

    Returns
    Type Description
    SeparatedSyntaxList<TNode>
    | Improve this Doc View Source

    ToFullString()

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

    Declaration
    public readonly string ToFullString()
    Returns
    Type Description
    System.String

    The full string representation of the nodes in this list including separators including separators, the first node's leading trivia, and the last node or token's trailing trivia.

    | Improve this Doc View Source

    ToString()

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

    Declaration
    public override readonly string ToString()
    Returns
    Type Description
    System.String

    The string representation of the nodes in this list including separators but not including the first node's leading trivia and the last node or token's trailing trivia.

    Overrides
    System.ValueType.ToString()

    Operators

    | Improve this Doc View Source

    Equality(SeparatedSyntaxList<TNode>, SeparatedSyntaxList<TNode>)

    Checks whether a list is equal to another.

    Declaration
    public static bool operator ==(SeparatedSyntaxList<TNode> left, SeparatedSyntaxList<TNode> right)
    Parameters
    Type Name Description
    SeparatedSyntaxList<TNode> left
    SeparatedSyntaxList<TNode> right
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Implicit(SeparatedSyntaxList<TNode> to SeparatedSyntaxList<SyntaxNode>)

    Converts a typed node list into an opaquely typed node list.

    Declaration
    public static implicit operator SeparatedSyntaxList<SyntaxNode>(SeparatedSyntaxList<TNode> nodes)
    Parameters
    Type Name Description
    SeparatedSyntaxList<TNode> nodes
    Returns
    Type Description
    SeparatedSyntaxList<SyntaxNode>
    | Improve this Doc View Source

    Implicit(SeparatedSyntaxList<SyntaxNode> to SeparatedSyntaxList<TNode>)

    Converts a list of opaquely typed nodes into a list of typed nodes.

    Declaration
    public static implicit operator SeparatedSyntaxList<TNode>(SeparatedSyntaxList<SyntaxNode> nodes)
    Parameters
    Type Name Description
    SeparatedSyntaxList<SyntaxNode> nodes
    Returns
    Type Description
    SeparatedSyntaxList<TNode>
    | Improve this Doc View Source

    Inequality(SeparatedSyntaxList<TNode>, SeparatedSyntaxList<TNode>)

    Checks whether two lists are not equal.

    Declaration
    public static bool operator !=(SeparatedSyntaxList<TNode> left, SeparatedSyntaxList<TNode> right)
    Parameters
    Type Name Description
    SeparatedSyntaxList<TNode> left
    SeparatedSyntaxList<TNode> right
    Returns
    Type Description
    System.Boolean

    Explicit Interface Implementations

    | Improve this Doc View Source

    IEnumerable.GetEnumerator()

    Declaration
    readonly IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    Implements

    IEquatable<>
    IReadOnlyList<>

    Extension Methods

    LuaExtensions.IndexOf<TNode>(SeparatedSyntaxList<TNode>, SyntaxKind)
    LuaExtensions.Any<TNode>(SeparatedSyntaxList<TNode>, SyntaxKind)
    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾