Struct TextRange
A range of the text of a document, 1-based (TextPosition): where it starts, and the position just after its last character.
public readonly record struct TextRange : IEquatable<TextRange>
- Implements
- Inherited Members
Constructors
TextRange(TextPosition, TextPosition)
A range of the text of a document, 1-based (TextPosition): where it starts, and the position just after its last character.
public TextRange(TextPosition Start, TextPosition End)
Parameters
StartTextPositionWhere the range starts.
EndTextPositionThe position just after its last character; Start for an empty range.
Properties
End
The position just after its last character; Start for an empty range.
public TextPosition End { get; init; }
Property Value
Start
Where the range starts.
public TextPosition Start { get; init; }
Property Value
Methods
Of(SourceRange)
The range a 0-based range is.
public static TextRange Of(SourceRange range)
Parameters
rangeSourceRangeThe 0-based range.
Returns
- TextRange
The same range, 1-based.
ToSourceRange()
The 0-based range this range is.
public SourceRange ToSourceRange()
Returns
- SourceRange
The same range, 0-based.
Exceptions
- ArgumentOutOfRangeException
A line or a column is less than 1.