SyntaxTriviaList Struct

Definition

Represents a read-only list of SyntaxTrivia.

public value class SyntaxTriviaList : IEquatable<Microsoft::CodeAnalysis::SyntaxTriviaList>, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::SyntaxTrivia>, System::Collections::Generic::IReadOnlyCollection<Microsoft::CodeAnalysis::SyntaxTrivia>, System::Collections::Generic::IReadOnlyList<Microsoft::CodeAnalysis::SyntaxTrivia>
public readonly struct SyntaxTriviaList : IEquatable<Microsoft.CodeAnalysis.SyntaxTriviaList>, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxTrivia>, System.Collections.Generic.IReadOnlyCollection<Microsoft.CodeAnalysis.SyntaxTrivia>, System.Collections.Generic.IReadOnlyList<Microsoft.CodeAnalysis.SyntaxTrivia>
type SyntaxTriviaList = struct
    interface IReadOnlyList<SyntaxTrivia>
    interface seq<SyntaxTrivia>
    interface IEnumerable
    interface IReadOnlyCollection<SyntaxTrivia>
Public Structure SyntaxTriviaList
Implements IEnumerable(Of SyntaxTrivia), IEquatable(Of SyntaxTriviaList), IReadOnlyCollection(Of SyntaxTrivia), IReadOnlyList(Of SyntaxTrivia)
Inheritance
SyntaxTriviaList
Implements

Constructors

SyntaxTriviaList(IEnumerable<SyntaxTrivia>)

Creates a list of trivia.

SyntaxTriviaList(SyntaxTrivia)
SyntaxTriviaList(SyntaxTrivia[])

Creates a list of trivia.

Properties

Count
Empty
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 trivia 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(SyntaxTrivia)

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

AddRange(IEnumerable<SyntaxTrivia>)

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

Any()

Does this list have any items.

Create(SyntaxTrivia)
ElementAt(Int32)
Equals(Object)
Equals(SyntaxTriviaList)
First()

Returns the first trivia in the list.

GetEnumerator()
GetHashCode()
IndexOf(SyntaxTrivia)
Insert(Int32, SyntaxTrivia)

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

InsertRange(Int32, IEnumerable<SyntaxTrivia>)

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

Last()

Returns the last trivia in the list.

Remove(SyntaxTrivia)

Creates a new SyntaxTriviaList with the specified element removed.

RemoveAt(Int32)

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

Replace(SyntaxTrivia, SyntaxTrivia)

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

ReplaceRange(SyntaxTrivia, IEnumerable<SyntaxTrivia>)

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

Reverse()

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

ToFullString()
ToString()

Operators

Equality(SyntaxTriviaList, SyntaxTriviaList)
Inequality(SyntaxTriviaList, SyntaxTriviaList)

Explicit Interface Implementations

IEnumerable.GetEnumerator()
IEnumerable<SyntaxTrivia>.GetEnumerator()

Extension Methods

NormalizeWhitespace(SyntaxTriviaList, String, Boolean)

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

NormalizeWhitespace(SyntaxTriviaList, String, String, Boolean)

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

Any(SyntaxTriviaList, SyntaxKind)

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

IndexOf(SyntaxTriviaList, SyntaxKind)

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

NormalizeWhitespace(SyntaxTriviaList, String, String, Boolean, Boolean)
Any(SyntaxTriviaList, SyntaxKind)

Tests whether a list contains trivia of a particular kind.

IndexOf(SyntaxTriviaList, SyntaxKind)

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

Applies to