TextChangeRange Struct
Describes a region of old text that was replaced, and how long the replacement is.
public readonly struct TextChangeRange : IEquatable<TextChangeRange>Remarks
Unlike TextChange, a range does not carry the replacement text. It is what an incremental parser needs: enough to map a position in the new text back to the old one.
- Implements
Constructors
| Name | Description |
|---|---|
| TextChangeRange(TextSpan, int) |
TextChangeRange(TextSpan, int)
TextChangeRange.csProperties
| Name | Description |
|---|---|
| Delta | Gets the number of characters the text grew by, which is negative when it shrank. |
| NewLength | Gets the length the range occupies in the new text. |
| Span | Gets the replaced range, in the old text. |
Delta
TextChangeRange.csNewLength
TextChangeRange.csMethods
| Name | Description |
|---|---|
| Collapse(IEnumerable<TextChangeRange>) | Combines changes into the single range that spans all of them. |
| Equals(TextChangeRange) | |
| Equals(object?) | |
| GetHashCode() | |
| ToString() |
Collapse(IEnumerable<TextChangeRange>)
TextChangeRange.csCombines changes into the single range that spans all of them.
public static TextChangeRange Collapse(IEnumerable<TextChangeRange> changes)Parameters
changesIEnumerable<TextChangeRange>- The ranges to combine. They are expected to be ordered by
TextChangeRange.Spanand not to overlap.
Returns
TextChangeRange A range covering every change, or default when there is none.
Exceptions
ArgumentNullExceptionchangesisnull.
Equals overloads
Equals(TextChangeRange)
TextChangeRange.cspublic bool Equals(TextChangeRange other)No documentation is available.
Equals(object?)
TextChangeRange.csGetHashCode()
TextChangeRange.csToString()
TextChangeRange.csOperators
| Name | Description |
|---|---|
| operator ==(TextChangeRange, TextChangeRange) | |
| operator !=(TextChangeRange, TextChangeRange) |
operator ==(TextChangeRange, TextChangeRange)
TextChangeRange.cspublic static bool operator ==(TextChangeRange left, TextChangeRange right)No documentation is available.
operator !=(TextChangeRange, TextChangeRange)
TextChangeRange.cspublic static bool operator !=(TextChangeRange left, TextChangeRange right)No documentation is available.