|
| 1 | +Fix textMate type errors for vscode 1.108.2 upgrade |
| 2 | + |
| 3 | +Type incompatibilities between IFontInfo[]/IFontToken[] and |
| 4 | +IRawThemeSetting[]/ITextMateThemingRule[] after upstream changes. |
| 5 | + |
| 6 | +--- |
| 7 | + src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts | 4 ++-- |
| 8 | + src/vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport.ts | 4 ++-- |
| 9 | + 2 files changed, 4 insertions(+), 4 deletions(-) |
| 10 | + |
| 11 | +Index: third-party-src/src/vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport.ts |
| 12 | +=================================================================== |
| 13 | +--- third-party-src.orig/src/vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport.ts |
| 14 | ++++ third-party-src/src/vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport.ts |
| 15 | +@@ -62,7 +62,7 @@ export class TextMateTokenizationSupport |
| 16 | + if (textMateResult.stoppedEarly) { |
| 17 | + console.warn(`Time limit reached when tokenizing line: ${line.substring(0, 100)}`); |
| 18 | + // return the state at the beginning of the line |
| 19 | +- return new EncodedTokenizationResult(textMateResult.tokens, textMateResult.fonts, state); |
| 20 | ++ return new EncodedTokenizationResult(textMateResult.tokens, textMateResult.fonts as any, state); |
| 21 | + } |
| 22 | + |
| 23 | + if (this._containsEmbeddedLanguages) { |
| 24 | +@@ -89,6 +89,6 @@ export class TextMateTokenizationSupport |
| 25 | + endState = textMateResult.ruleStack; |
| 26 | + } |
| 27 | + |
| 28 | +- return new EncodedTokenizationResult(textMateResult.tokens, textMateResult.fonts, endState); |
| 29 | ++ return new EncodedTokenizationResult(textMateResult.tokens, textMateResult.fonts as any, endState); |
| 30 | + } |
| 31 | + } |
| 32 | +Index: third-party-src/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts |
| 33 | +=================================================================== |
| 34 | +--- third-party-src.orig/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts |
| 35 | ++++ third-party-src/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts |
| 36 | +@@ -337,15 +337,15 @@ export class TextMateTokenizationFeature |
| 37 | + } |
| 38 | + |
| 39 | + private _updateTheme(colorTheme: IWorkbenchColorTheme, forceUpdate: boolean): void { |
| 40 | +- if (!forceUpdate && this._currentTheme && this._currentTokenColorMap && equalsTokenRules(this._currentTheme.settings, colorTheme.tokenColors) |
| 41 | ++ if (!forceUpdate && this._currentTheme && this._currentTokenColorMap && equalsTokenRules(this._currentTheme.settings as any, colorTheme.tokenColors) |
| 42 | + && equalArray(this._currentTokenColorMap, colorTheme.tokenColorMap) && this._currentTokenFontMap && equalArray(this._currentTokenFontMap, colorTheme.tokenFontMap)) { |
| 43 | + return; |
| 44 | + } |
| 45 | +- this._currentTheme = { name: colorTheme.label, settings: colorTheme.tokenColors }; |
| 46 | ++ this._currentTheme = { name: colorTheme.label, settings: colorTheme.tokenColors as any }; |
| 47 | + this._currentTokenColorMap = colorTheme.tokenColorMap; |
| 48 | + this._currentTokenFontMap = colorTheme.tokenFontMap; |
| 49 | + |
| 50 | +- this._grammarFactory?.setTheme(this._currentTheme, this._currentTokenColorMap); |
| 51 | ++ this._grammarFactory?.setTheme(this._currentTheme!, this._currentTokenColorMap); |
| 52 | + const colorMap = toColorMap(this._currentTokenColorMap); |
| 53 | + const colorCssRules = generateTokensCSSForColorMap(colorMap); |
| 54 | + const fontCssRules = generateTokensCSSForFontMap(this._currentTokenFontMap); |
0 commit comments