1
>
/*---------------------------------------------------------------------------------------------
textLength.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
import { LineRange } from '../ranges/lineRange.js';
6
>
import { Position } from '../position.js';
7
>
import { Range } from '../range.js';
8
>
import { OffsetRange } from '../ranges/offsetRange.js';
9
>
10
>
/**
11
>
* Represents a non-negative length of text in terms of line and column count.
12
>
*/
13
>
export class TextLength {
14
>
public static zero = new TextLength(0, 0);
15
>
16
>
public static lengthDiffNonNegative(start: TextLength, end: TextLength): TextLength {
17
if (end.isLessThan(start)) {
18
return TextLength.zero;