src/vs/editor/common/model/textModelTokens.ts/TokenizationStateStore/setEndState
class TokenizationStateStore:	public setEndState(linesLength: number, lineIndex: number, endState: IState): void {
		this._lineNeedsTokenization.set(lineIndex, false);
		this._firstLineNeedsTokenization = lineIndex + 1;

		// Check if this was the last line
		if (lineIndex === linesLength - 1) {
			return;
		}

		// Check if the end state has changed
		const previousEndState = this._lineBeginState.get(lineIndex + 1);
		if (previousEndState === null || !endState.equals(previousEndState)) {
			this._lineBeginState.set(lineIndex + 1, endState);
			this.markMustBeTokenized(lineIndex + 1);
			return;
		}

		// Perhaps we can skip tokenizing some lines...
		let i = lineIndex + 1;
		while (i < linesLength) {
			if (this._lineNeedsTokenization.get(i)) {
				break;
			}
			i++;
		}
		this._firstLineNeedsTokenization = i;
	}