TextStudioTextRange
public struct TextStudioTextRangeA half-open range of logical text units, resolved relative to one scope.
Constructors
Section titled “Constructors”
TextStudioTextRange(int, int, bool, bool)
Section titled “TextStudioTextRange(int, int, bool, bool)”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 |
Methods
Section titled “Methods”
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
Resolve(int, out int, out int)
Section titled “Resolve(int, out int, out int)”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 |
ToString()
Section titled “ToString()”public override string ToString()Returns
System.String
Equals(TextStudioTextRange)
Section titled “Equals(TextStudioTextRange)”public bool Equals(TextStudioTextRange other)Parameters
| Name | Type |
|---|---|
other |
TextStudio.TextStudioTextRange |
Returns
System.Boolean
Equals(object)
Section titled “Equals(object)”public override bool Equals(object obj)Parameters
| Name | Type |
|---|---|
obj |
System.Object |
Returns
System.Boolean
GetHashCode()
Section titled “GetHashCode()”public override int GetHashCode()Returns
System.Int32
Properties
Section titled “Properties”
HasStart
Section titled “HasStart”public bool HasStart { get; }Returns
System.Boolean
HasEnd
Section titled “HasEnd”public bool HasEnd { get; }Returns
System.Boolean
public int End { get; }Returns
System.Int32
StartFromEnd
Section titled “StartFromEnd”public bool StartFromEnd { get; }Returns
System.Boolean
EndFromEnd
Section titled “EndFromEnd”public bool EndFromEnd { get; }Returns
System.Boolean
IsValid
Section titled “IsValid”public bool IsValid { get; }Returns
System.Boolean
public static TextStudioTextRange All { get; }Returns
TextStudio.TextStudioTextRange