modeTransition.ts 830 字节
Newer Older
A
Alex Dima 已提交
1 2 3 4 5 6
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

J
Johannes Rieken 已提交
7
import { Arrays } from 'vs/editor/common/core/arrays';
A
Alex Dima 已提交
8

9 10
export class ModeTransition {
	_modeTransitionBrand: void;
A
Alex Dima 已提交
11

12 13
	public readonly startIndex: number;
	public readonly modeId: string;
A
Alex Dima 已提交
14

J
Johannes Rieken 已提交
15 16
	constructor(startIndex: number, modeId: string) {
		this.startIndex = startIndex | 0;
A
Alex Dima 已提交
17 18 19
		this.modeId = modeId;
	}

J
Johannes Rieken 已提交
20
	public static findIndexInSegmentsArray(arr: ModeTransition[], desiredIndex: number): number {
A
Alex Dima 已提交
21 22 23
		return Arrays.findIndexInSegmentsArray(arr, desiredIndex);
	}
}