Search Results for

    Show / Hide Table of Contents

    Struct TextChangeRange

    Represents the change to a span of text.

    Implements
    IEquatable<TextChangeRange>
    Inherited Members
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    Namespace: Loretta.CodeAnalysis.Text
    Assembly: cs.temp.dll.dll
    Syntax
    public readonly struct TextChangeRange

    Constructors

    TextChangeRange(TextSpan, Int32)

    Initializes a new instance of TextChangeRange.

    Declaration
    public TextChangeRange(TextSpan span, int newLength)
    Parameters
    Type Name Description
    TextSpan span
    System.Int32 newLength

    Properties

    NewLength

    Width of the span after the edit. A 0 here would represent a delete

    Declaration
    public readonly int NewLength { get; }
    Property Value
    Type Description
    System.Int32

    NoChanges

    An empty set of changes.

    Declaration
    public static readonly IReadOnlyList<TextChangeRange> NoChanges { get; }
    Property Value
    Type Description
    IReadOnlyList<TextChangeRange>

    Span

    The span of text before the edit which is being changed

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

    Methods

    Collapse(IEnumerable<TextChangeRange>)

    Collapse a set of TextChangeRanges into a single encompassing range. If the set of ranges provided is empty, an empty range is returned.

    Declaration
    public static TextChangeRange Collapse(IEnumerable<TextChangeRange> changes)
    Parameters
    Type Name Description
    IEnumerable<TextChangeRange> changes
    Returns
    Type Description
    TextChangeRange

    Equals(TextChangeRange)

    Compares current instance of TextChangeRange to another.

    Declaration
    public readonly bool Equals(TextChangeRange other)
    Parameters
    Type Name Description
    TextChangeRange other
    Returns
    Type Description
    System.Boolean

    Equals(Object)

    Compares current instance of TextChangeRange to another.

    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)

    GetHashCode()

    Provides hash code for current instance of TextChangeRange.

    Declaration
    public override readonly int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.ValueType.GetHashCode()

    ToString()

    Converts the text change range to a string.

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

    Operators

    Equality(TextChangeRange, TextChangeRange)

    Determines if two instances of TextChangeRange are same.

    Declaration
    public static bool operator ==(TextChangeRange left, TextChangeRange right)
    Parameters
    Type Name Description
    TextChangeRange left
    TextChangeRange right
    Returns
    Type Description
    System.Boolean

    Inequality(TextChangeRange, TextChangeRange)

    Determines if two instances of TextChangeRange are different.

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

    Implements

    IEquatable<>
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾