48
constructor(startLine: number, startColumn: number, endLine: number, endColumn: number);
49
constructor(startLineOrStart: number | Position | vscode.Position, startColumnOrEnd: number | Position | vscode.Position, endLine?: number, endColumn?: number) {
50
>
let start: Position | undefined;
range.ts
51
>
let end: Position | undefined;
52
>
53
>
if (typeof startLineOrStart === 'number' && typeof startColumnOrEnd === 'number' && typeof endLine === 'number' && typeof endColumn === 'number') {
54
>
start = new Position(startLineOrStart, startColumnOrEnd);
55
>
end = new Position(endLine, endColumn);
56
>
} else if (Position.isPosition(startLineOrStart) && Position.isPosition(startColumnOrEnd)) {
57
start = Position.of(startLineOrStart);
58
end = Position.of(startColumnOrEnd);
59
}
61
>
if (!start || !end) {
62
throw new Error('Invalid arguments');
63
}
65
>
if (start.isBefore(end)) {
66
>
this._start = start;
67
>
this._end = end;
68
>
} else {
69
this._start = end;
70
this._end = start;
71
}
73
74
contains(positionOrRange: Position | Range): boolean {