Skip to content

TextStudioTextRange

StructTextStudioTextStudio
public struct TextStudioTextRange

A half-open range of logical text units, resolved relative to one scope.

public TextStudioTextRange(int start, int end, bool startFromEnd = false, bool endFromEnd = false)

Creates a half-open range with explicit nonnegative endpoints that may be measured from the end of a scope.

Parameters

NameType
startSystem.Int32
endSystem.Int32
startFromEndSystem.Boolean
endFromEndSystem.Boolean

TryParse(string, out TextStudioTextRange, out string)

Section titled “TryParse(string, out TextStudioTextRange, out string)”
public static bool TryParse(string text, out TextStudioTextRange range, out string diagnostic)

Parses a start..end range with optional endpoints and ^ offsets from the end, returning a diagnostic for invalid syntax.

Parameters

NameType
textSystem.String
rangeTextStudio.TextStudioTextRange
diagnosticSystem.String

Returns

System.Boolean

public void Resolve(int scopeLength, out int start, out int end)

Resolves endpoints against a nonnegative scope length, clamps them to the scope, and collapses reversed ranges to empty.

Parameters

NameType
scopeLengthSystem.Int32
startSystem.Int32
endSystem.Int32
public override string ToString()

Returns

System.String

public bool Equals(TextStudioTextRange other)

Parameters

NameType
otherTextStudio.TextStudioTextRange

Returns

System.Boolean

public override bool Equals(object obj)

Parameters

NameType
objSystem.Object

Returns

System.Boolean

public override int GetHashCode()

Returns

System.Int32

public bool HasStart { get; }

Returns

System.Boolean

public bool HasEnd { get; }

Returns

System.Boolean

public int End { get; }

Returns

System.Int32

public bool StartFromEnd { get; }

Returns

System.Boolean

public bool EndFromEnd { get; }

Returns

System.Boolean

public bool IsValid { get; }

Returns

System.Boolean

public static TextStudioTextRange All { get; }

Returns

TextStudio.TextStudioTextRange