Remove offsetDelta from tokenization methods

This commit is contained in:
Alex Dima
2021-12-28 16:07:42 +01:00
parent 9714e1f51e
commit eabc27b8e6
14 changed files with 72 additions and 111 deletions

View File

@@ -446,18 +446,14 @@ class TMTokenizationSupport implements ITokenizationSupport {
return this._actual.getInitialState();
}
tokenize(line: string, hasEOL: boolean, state: IState, offsetDelta: number): TokenizationResult {
tokenize(line: string, hasEOL: boolean, state: IState): TokenizationResult {
throw new Error('Not supported!');
}
tokenizeEncoded(line: string, hasEOL: boolean, state: StackElement, offsetDelta: number): EncodedTokenizationResult {
if (offsetDelta !== 0) {
throw new Error('Unexpected: offsetDelta should be 0.');
}
tokenizeEncoded(line: string, hasEOL: boolean, state: StackElement): EncodedTokenizationResult {
// Do not attempt to tokenize if a line is too long
if (line.length >= this._maxTokenizationLineLength) {
return nullTokenizeEncoded(this._encodedLanguageId, line, state, offsetDelta);
return nullTokenizeEncoded(this._encodedLanguageId, state);
}
return this._actual.tokenizeEncoded(line, state);