Search Results for

    Show / Hide Table of Contents

    Struct SyntaxTriviaList

    Represents a read-only list of SyntaxTrivia.

    Implements
    IEquatable<SyntaxTriviaList>
    IReadOnlyList<SyntaxTrivia>
    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 SyntaxTriviaList

    Constructors

    | Improve this Doc View Source

    SyntaxTriviaList(SyntaxTrivia)

    Creates a new trivia list with the provided trivia as the only element.

    Declaration
    public SyntaxTriviaList(SyntaxTrivia trivia)
    Parameters
    Type Name Description
    SyntaxTrivia trivia
    | Improve this Doc View Source

    SyntaxTriviaList(SyntaxTrivia[])

    Creates a list of trivia.

    Declaration
    public SyntaxTriviaList(params SyntaxTrivia[] trivias)
    Parameters
    Type Name Description
    SyntaxTrivia[] trivias

    An array of trivia.

    | Improve this Doc View Source

    SyntaxTriviaList(Nullable<IEnumerable<SyntaxTrivia>>)

    Creates a list of trivia.

    Declaration
    public SyntaxTriviaList(IEnumerable<SyntaxTrivia>? trivias)
    Parameters
    Type Name Description
    System.Nullable<System.Collections.IEnumerable<SyntaxTrivia>> trivias

    A sequence of trivia.

    Properties

    | Improve this Doc View Source

    Count

    The amount of elements in this list.

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

    Empty

    An empty trivia list.

    Declaration
    public static readonly SyntaxTriviaList Empty { get; }
    Property Value
    Type Description
    SyntaxTriviaList
    | 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]

    Gets the trivia at the specified index.

    Declaration
    public readonly SyntaxTrivia this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the trivia to get.

    Property Value
    Type Description
    SyntaxTrivia

    The token at the specified index.

    | 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(SyntaxTrivia)

    Creates a new SyntaxTriviaList with the specified trivia added to the end.

    Declaration
    public readonly SyntaxTriviaList Add(SyntaxTrivia trivia)
    Parameters
    Type Name Description
    SyntaxTrivia trivia

    The trivia to add.

    Returns
    Type Description
    SyntaxTriviaList
    | Improve this Doc View Source

    AddRange(IEnumerable<SyntaxTrivia>)

    Creates a new SyntaxTriviaList with the specified trivia added to the end.

    Declaration
    public readonly SyntaxTriviaList AddRange(IEnumerable<SyntaxTrivia> trivia)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<SyntaxTrivia> trivia

    The trivia to add.

    Returns
    Type Description
    SyntaxTriviaList
    | Improve this Doc View Source

    Any()

    Does this list have any items.

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

    Create(SyntaxTrivia)

    Creates a new trivia list.

    Declaration
    public static SyntaxTriviaList Create(SyntaxTrivia trivia)
    Parameters
    Type Name Description
    SyntaxTrivia trivia
    Returns
    Type Description
    SyntaxTriviaList
    | Improve this Doc View Source

    ElementAt(Int32)

    Returns the element at the provided index.

    Declaration
    public readonly SyntaxTrivia ElementAt(int index)
    Parameters
    Type Name Description
    System.Int32 index
    Returns
    Type Description
    SyntaxTrivia
    | Improve this Doc View Source

    Equals(SyntaxTriviaList)

    Declaration
    public readonly bool Equals(SyntaxTriviaList other)
    Parameters
    Type Name Description
    SyntaxTriviaList 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 trivia in the list.

    Declaration
    public readonly SyntaxTrivia First()
    Returns
    Type Description
    SyntaxTrivia

    The first trivia in the list.

    | Improve this Doc View Source

    GetEnumerator()

    Returns the enumerator for this list.

    Declaration
    public readonly SyntaxTriviaList.Enumerator GetEnumerator()
    Returns
    Type Description
    SyntaxTriviaList.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

    IndexOf(SyntaxTrivia)

    Returns the index of the provided trivia in this list.

    Declaration
    public readonly int IndexOf(SyntaxTrivia triviaInList)
    Parameters
    Type Name Description
    SyntaxTrivia triviaInList
    Returns
    Type Description
    System.Int32

    -1 if not found.

    | Improve this Doc View Source

    Insert(Int32, SyntaxTrivia)

    Creates a new SyntaxTriviaList with the specified trivia inserted at the index.

    Declaration
    public readonly SyntaxTriviaList Insert(int index, SyntaxTrivia trivia)
    Parameters
    Type Name Description
    System.Int32 index

    The index in the list to insert the trivia at.

    SyntaxTrivia trivia

    The trivia to insert.

    Returns
    Type Description
    SyntaxTriviaList
    | Improve this Doc View Source

    InsertRange(Int32, IEnumerable<SyntaxTrivia>)

    Creates a new SyntaxTriviaList with the specified trivia inserted at the index.

    Declaration
    public readonly SyntaxTriviaList InsertRange(int index, IEnumerable<SyntaxTrivia> trivia)
    Parameters
    Type Name Description
    System.Int32 index

    The index in the list to insert the trivia at.

    System.Collections.IEnumerable<SyntaxTrivia> trivia

    The trivia to insert.

    Returns
    Type Description
    SyntaxTriviaList
    | Improve this Doc View Source

    Last()

    Returns the last trivia in the list.

    Declaration
    public readonly SyntaxTrivia Last()
    Returns
    Type Description
    SyntaxTrivia

    The last trivia in the list.

    | Improve this Doc View Source

    Remove(SyntaxTrivia)

    Creates a new SyntaxTriviaList with the specified element removed.

    Declaration
    public readonly SyntaxTriviaList Remove(SyntaxTrivia triviaInList)
    Parameters
    Type Name Description
    SyntaxTrivia triviaInList

    The trivia element to remove.

    Returns
    Type Description
    SyntaxTriviaList
    | Improve this Doc View Source

    RemoveAt(Int32)

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

    Declaration
    public readonly SyntaxTriviaList RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The index identifying the element to remove.

    Returns
    Type Description
    SyntaxTriviaList
    | Improve this Doc View Source

    Replace(SyntaxTrivia, SyntaxTrivia)

    Creates a new SyntaxTriviaList with the specified element replaced with new trivia.

    Declaration
    public readonly SyntaxTriviaList Replace(SyntaxTrivia triviaInList, SyntaxTrivia newTrivia)
    Parameters
    Type Name Description
    SyntaxTrivia triviaInList

    The trivia element to replace.

    SyntaxTrivia newTrivia

    The trivia to replace the element with.

    Returns
    Type Description
    SyntaxTriviaList
    | Improve this Doc View Source

    ReplaceRange(SyntaxTrivia, IEnumerable<SyntaxTrivia>)

    Creates a new SyntaxTriviaList with the specified element replaced with new trivia.

    Declaration
    public readonly SyntaxTriviaList ReplaceRange(SyntaxTrivia triviaInList, IEnumerable<SyntaxTrivia> newTrivia)
    Parameters
    Type Name Description
    SyntaxTrivia triviaInList

    The trivia element to replace.

    System.Collections.IEnumerable<SyntaxTrivia> newTrivia

    The trivia to replace the element with.

    Returns
    Type Description
    SyntaxTriviaList
    | Improve this Doc View Source

    Reverse()

    Returns a list which contains all elements of SyntaxTriviaList in reversed order.

    Declaration
    public readonly SyntaxTriviaList.Reversed Reverse()
    Returns
    Type Description
    SyntaxTriviaList.Reversed

    SyntaxTriviaList.Reversed which contains all elements of SyntaxTriviaList in reversed order

    | Improve this Doc View Source

    ToFullString()

    Returns the list as a string including leading and trailing trivia.

    Declaration
    public readonly string ToFullString()
    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    ToString()

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

    Operators

    | Improve this Doc View Source

    Equality(SyntaxTriviaList, SyntaxTriviaList)

    Checks whether two trivia lists are equal.

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

    Inequality(SyntaxTriviaList, SyntaxTriviaList)

    Checks whether two trivia lists are not equal.

    Declaration
    public static bool operator !=(SyntaxTriviaList left, SyntaxTriviaList right)
    Parameters
    Type Name Description
    SyntaxTriviaList left
    SyntaxTriviaList 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(SyntaxTriviaList, SyntaxKind)
    LuaExtensions.Any(SyntaxTriviaList, SyntaxKind)
    SyntaxExtensions.NormalizeWhitespace(SyntaxTriviaList, String, Boolean)
    SyntaxExtensions.NormalizeWhitespace(SyntaxTriviaList, String, String, Boolean)
    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾