@codingame/monaco-vscode-textmate-service-override 6.0.3 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-textmate-service-override",
3
- "version": "6.0.3",
3
+ "version": "7.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -29,9 +29,9 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "vscode": "npm:@codingame/monaco-vscode-api@6.0.3",
32
+ "vscode": "npm:@codingame/monaco-vscode-api@7.0.0",
33
33
  "vscode-oniguruma": "1.7.0",
34
34
  "vscode-textmate": "9.0.0",
35
- "@codingame/monaco-vscode-files-service-override": "6.0.3"
35
+ "@codingame/monaco-vscode-files-service-override": "7.0.0"
36
36
  }
37
37
  }
@@ -14,6 +14,7 @@ import { LineTokens } from 'vscode/vscode/vs/editor/common/tokens/lineTokens';
14
14
  import { TextMateTokenizationSupport } from '../../tokenizationSupport/textMateTokenizationSupport.js';
15
15
  import { TokenizationSupportWithLineLimit } from '../../tokenizationSupport/tokenizationSupportWithLineLimit.js';
16
16
  import { diffStateStacksRefEq } from 'vscode-textmate';
17
+ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
17
18
 
18
19
  class TextMateWorkerTokenizer extends MirrorTextModel {
19
20
  constructor(uri, lines, eol, versionId, _host, _languageId, _encodedLanguageId, maxTokenizationLineLength) {
@@ -70,7 +71,7 @@ class TextMateWorkerTokenizer extends MirrorTextModel {
70
71
  this._host.reportTokenizationTime(timeMs, languageId, r.sourceExtensionId, lineLength, isRandomSample);
71
72
  },
72
73
  false
73
- )), this._maxTokenizationLineLength));
74
+ )), Disposable.None, this._maxTokenizationLineLength));
74
75
  this._tokenizerWithStateStore = ( new TokenizerWithStateStore(this._lines.length, tokenizationSupport));
75
76
  }
76
77
  else {
@@ -70,9 +70,9 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
70
70
  this._register(this._themeService.onDidColorThemeChange(() => {
71
71
  this._updateTheme(this._themeService.getColorTheme(), false);
72
72
  }));
73
- this._languageService.onDidRequestRichLanguageFeatures((languageId) => {
73
+ this._register(this._languageService.onDidRequestRichLanguageFeatures((languageId) => {
74
74
  this._createdModes.push(languageId);
75
- });
75
+ }));
76
76
  }
77
77
  getAsyncTokenizationEnabled() {
78
78
  return !!this._configurationService.getValue('editor.experimental.asyncTokenization');
@@ -144,7 +144,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
144
144
  }
145
145
  }
146
146
  }
147
- const validLanguageId = grammar.language && this._languageService.isRegisteredLanguageId(grammar.language) ? grammar.language : null;
147
+ const validLanguageId = grammar.language && this._languageService.isRegisteredLanguageId(grammar.language) ? grammar.language : undefined;
148
148
  function asStringArray(array, defaultValue) {
149
149
  if (!Array.isArray(array)) {
150
150
  return defaultValue;
@@ -156,7 +156,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
156
156
  }
157
157
  return {
158
158
  location: grammarLocation,
159
- language: validLanguageId || undefined,
159
+ language: validLanguageId,
160
160
  scopeName: grammar.scopeName,
161
161
  embeddedLanguages: embeddedLanguages,
162
162
  tokenTypes: tokenTypes,
@@ -256,7 +256,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
256
256
  },
257
257
  true
258
258
  )));
259
- tokenization.onDidEncounterLanguage((encodedLanguageId) => {
259
+ const disposable = tokenization.onDidEncounterLanguage((encodedLanguageId) => {
260
260
  if (!this._encounteredLanguages[encodedLanguageId]) {
261
261
  const languageId = this._languageService.languageIdCodec.decodeLanguageId(encodedLanguageId);
262
262
  this._encounteredLanguages[encodedLanguageId] = true;
@@ -264,7 +264,7 @@ let TextMateTokenizationFeature = class TextMateTokenizationFeature extends Disp
264
264
  }
265
265
  });
266
266
  return (
267
- (new TokenizationSupportWithLineLimit(encodedLanguageId, tokenization, maxTokenizationLineLength))
267
+ (new TokenizationSupportWithLineLimit(encodedLanguageId, tokenization, disposable, maxTokenizationLineLength))
268
268
  );
269
269
  }
270
270
  catch (err) {
@@ -10,12 +10,13 @@ class TokenizationSupportWithLineLimit extends Disposable {
10
10
  get backgroundTokenizerShouldOnlyVerifyTokens() {
11
11
  return this._actual.backgroundTokenizerShouldOnlyVerifyTokens;
12
12
  }
13
- constructor(_encodedLanguageId, _actual, _maxTokenizationLineLength) {
13
+ constructor(_encodedLanguageId, _actual, disposable, _maxTokenizationLineLength) {
14
14
  super();
15
15
  this._encodedLanguageId = _encodedLanguageId;
16
16
  this._actual = _actual;
17
17
  this._maxTokenizationLineLength = _maxTokenizationLineLength;
18
18
  this._register(keepObserved(this._maxTokenizationLineLength));
19
+ this._register(disposable);
19
20
  }
20
21
  getInitialState() {
21
22
  return this._actual.getInitialState();