Skip to content

Commit

Permalink
Update vscode-textmate dependency (#12963)
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew authored Oct 3, 2023
1 parent 525b3b1 commit 4c8a64d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/monaco/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"idb": "^4.0.5",
"jsonc-parser": "^2.2.0",
"vscode-oniguruma": "1.6.1",
"vscode-textmate": "^7.0.3"
"vscode-textmate": "^9.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
16 changes: 8 additions & 8 deletions packages/monaco/src/browser/textmate/textmate-tokenizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
// *****************************************************************************

import { INITIAL, IGrammar, StackElement } from 'vscode-textmate';
import { INITIAL, IGrammar, StateStack } from 'vscode-textmate';
import * as monaco from '@theia/monaco-editor-core';

export class TokenizerState implements monaco.languages.IState {

constructor(
public readonly stackElement: StackElement
public readonly stateStack: StateStack
) { }

clone(): monaco.languages.IState {
return new TokenizerState(this.stackElement);
return new TokenizerState(this.stateStack);
}

equals(other: monaco.languages.IState): boolean {
return other instanceof TokenizerState && (other === this || other.stackElement === this.stackElement);
return other instanceof TokenizerState && (other === this || other.stateStack === this.stateStack);
}

}
Expand Down Expand Up @@ -58,9 +58,9 @@ export function createTextmateTokenizer(grammar: IGrammar, options: TokenizerOpt
tokenizeEncoded(line: string, state: TokenizerState): monaco.languages.IEncodedLineTokens {
if (options.lineLimit !== undefined && line.length > options.lineLimit) {
// Skip tokenizing the line if it exceeds the line limit.
return { endState: state.stackElement, tokens: new Uint32Array() };
return { endState: state.stateStack, tokens: new Uint32Array() };
}
const result = grammar.tokenizeLine2(line, state.stackElement, 500);
const result = grammar.tokenizeLine2(line, state.stateStack, 500);
return {
endState: new TokenizerState(result.ruleStack),
tokens: result.tokens
Expand All @@ -69,9 +69,9 @@ export function createTextmateTokenizer(grammar: IGrammar, options: TokenizerOpt
tokenize(line: string, state: TokenizerState): monaco.languages.ILineTokens {
if (options.lineLimit !== undefined && line.length > options.lineLimit) {
// Skip tokenizing the line if it exceeds the line limit.
return { endState: state.stackElement, tokens: [] };
return { endState: state.stateStack, tokens: [] };
}
const result = grammar.tokenizeLine(line, state.stackElement, 500);
const result = grammar.tokenizeLine(line, state.stateStack, 500);
return {
endState: new TokenizerState(result.ruleStack),
tokens: result.tokens.map(t => ({
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-ext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"semver": "^7.5.4",
"uuid": "^8.0.0",
"vhost": "^3.0.2",
"vscode-textmate": "^7.0.3"
"vscode-textmate": "^9.0.0"
},
"publishConfig": {
"access": "public"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11220,10 +11220,10 @@ [email protected]:
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-5.2.0.tgz#01f01760a391e8222fe4f33fbccbd1ad71aed74e"
integrity sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==

vscode-textmate@^7.0.3:
version "7.0.4"
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-7.0.4.tgz#a30df59ce573e998e4e2ffbca5ab82d57bc3126f"
integrity sha512-9hJp0xL7HW1Q5OgGe03NACo7yiCTMEk3WU/rtKXUbncLtdg6rVVNJnHwD88UhbIYU2KoxY0Dih0x+kIsmUKn2A==
vscode-textmate@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-9.0.0.tgz#313c6c8792b0507aef35aeb81b6b370b37c44d6c"
integrity sha512-Cl65diFGxz7gpwbav10HqiY/eVYTO1sjQpmRmV991Bj7wAoOAjGQ97PpQcXorDE2Uc4hnGWLY17xme+5t6MlSg==

vscode-uri@^2.1.1:
version "2.1.2"
Expand Down

0 comments on commit 4c8a64d

Please sign in to comment.