Struct TextLocation
Represents a materialized source span with line and column information.
public readonly struct TextLocation : IEquatable<TextLocation>
- Implements
- Inherited Members
Constructors
TextLocation(TextSpan, TextPosition, TextPosition, Uri?)
Initializes a new instance of the TextLocation struct.
public TextLocation(TextSpan span, TextPosition start, TextPosition end, Uri? sourceDocument = null)
Parameters
spanTextSpanThe source span.
startTextPositionThe inclusive start position.
endTextPositionThe exclusive end position.
sourceDocumentUriThe source document URI, when available.
Exceptions
- ArgumentException
Thrown when a position does not match the span or
sourceDocumentis not absolute.
Properties
End
Gets the exclusive end position.
public TextPosition End { get; }
Property Value
SourceDocument
Gets the source document URI, when available.
public Uri? SourceDocument { get; }
Property Value
- Uri
Span
Gets the source span.
public TextSpan Span { get; }
Property Value
Start
Gets the inclusive start position.
public TextPosition Start { get; }
Property Value
Methods
Equals(TextLocation)
public bool Equals(TextLocation other)
Parameters
otherTextLocation
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(TextLocation, TextLocation)
public static bool operator ==(TextLocation left, TextLocation right)
Parameters
leftTextLocationrightTextLocation
Returns
operator !=(TextLocation, TextLocation)
public static bool operator !=(TextLocation left, TextLocation right)
Parameters
leftTextLocationrightTextLocation