diff --git a/package.json b/package.json index eb9596a8ce4..c44abde8630 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "vscode-debugprotocol": "1.28.0", "vscode-nsfw": "1.0.17", "vscode-ripgrep": "^1.0.1", - "vscode-textmate": "^4.0.0-next.2", + "vscode-textmate": "^4.0.1", "vscode-xterm": "3.5.0-beta17", "yauzl": "^2.9.1" }, diff --git a/src/vs/workbench/services/textMate/electron-browser/TMSyntax.ts b/src/vs/workbench/services/textMate/electron-browser/TMSyntax.ts index 6534fd720c5..d4fca9d949e 100644 --- a/src/vs/workbench/services/textMate/electron-browser/TMSyntax.ts +++ b/src/vs/workbench/services/textMate/electron-browser/TMSyntax.ts @@ -25,6 +25,7 @@ import { Color } from 'vs/base/common/color'; import { INotificationService } from 'vs/platform/notification/common/notification'; import URI from 'vs/base/common/uri'; import { IFileService } from 'vs/platform/files/common/files'; +import { ILogService } from 'vs/platform/log/common/log'; export class TMScopeRegistry { @@ -139,6 +140,7 @@ export class TextMateService implements ITextMateService { private _modeService: IModeService; private _themeService: IWorkbenchThemeService; private _fileService: IFileService; + private _logService: ILogService; private _scopeRegistry: TMScopeRegistry; private _injections: { [scopeName: string]: string[]; }; private _injectedEmbeddedLanguages: { [scopeName: string]: IEmbeddedLanguagesMap[]; }; @@ -155,13 +157,15 @@ export class TextMateService implements ITextMateService { @IModeService modeService: IModeService, @IWorkbenchThemeService themeService: IWorkbenchThemeService, @IFileService fileService: IFileService, - @INotificationService notificationService: INotificationService + @INotificationService notificationService: INotificationService, + @ILogService logService: ILogService ) { this._styleElement = dom.createStyleSheet(); this._styleElement.className = 'vscode-tokens-styles'; this._modeService = modeService; this._themeService = themeService; this._fileService = fileService; + this._logService = logService; this._scopeRegistry = new TMScopeRegistry(); this.onDidEncounterLanguage = this._scopeRegistry.onDidEncounterLanguage; this._injections = {}; @@ -212,10 +216,14 @@ export class TextMateService implements ITextMateService { loadGrammar: (scopeName: string) => { const location = this._scopeRegistry.getGrammarLocation(scopeName); if (!location) { + this._logService.info(`No grammar found for scope ${scopeName}`); return null; } return this._fileService.resolveContent(location).then(content => { return parseRawGrammar(content.value, location.path); + }, e => { + this._logService.error(`Unable to load and parse grammar for scope ${scopeName} from ${location}`, e); + return null; }); }, getInjections: (scopeName: string) => { diff --git a/yarn.lock b/yarn.lock index ef6a6fc2334..3c5efb1299a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1798,7 +1798,7 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -fast-plist@0.1.2, fast-plist@^0.1.2: +fast-plist@0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/fast-plist/-/fast-plist-0.1.2.tgz#a45aff345196006d406ca6cdcd05f69051ef35b8" @@ -6250,11 +6250,10 @@ vscode-ripgrep@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.0.1.tgz#eff2f2b2a49921ac0acd3ff8dfecaaeebf0184cf" -vscode-textmate@^4.0.0-next.2: - version "4.0.0-next.2" - resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-4.0.0-next.2.tgz#03b6c1feb7d297cb70e24cc1166ce2d5c619e440" +vscode-textmate@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-4.0.1.tgz#6c36f28e9059ce12bc34907f7a33ea43166b26a8" dependencies: - fast-plist "^0.1.2" oniguruma "^7.0.0" vscode-xterm@3.5.0-beta17: