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

Name Type
start System.Int32
end System.Int32
startFromEnd System.Boolean
endFromEnd System.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

Name Type
text System.String
range TextStudio.TextStudioTextRange
diagnostic System.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

Name Type
scopeLength System.Int32
start System.Int32
end System.Int32
public override string ToString()

Returns

System.String

public bool Equals(TextStudioTextRange other)

Parameters

Name Type
other TextStudio.TextStudioTextRange

Returns

System.Boolean

public override bool Equals(object obj)

Parameters

Name Type
obj System.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