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.GetType()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Loretta.CodeAnalysis.Text
    Assembly: Loretta.CodeAnalysis.dll
    Syntax
    public readonly struct TextChangeRange

    Constructors

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    NoChanges

    An empty set of changes.

    Declaration
    public static readonly IReadOnlyList<TextChangeRange> NoChanges { get; }
    Property Value
    Type Description
    IReadOnlyList<TextChangeRange>
    | Improve this Doc View Source

    Span

    The span of text before the edit which is being changed

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

    Methods

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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)
    | Improve this Doc View Source

    GetHashCode()

    Provides hash code for current instance of TextChangeRange.

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

    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

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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<>
    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top

    Copyright (c) LorettaDevs

    Generated by DocFX

    ☀
    ☾