This commit is contained in:
Alex Dima
2022-03-15 09:35:08 +01:00
parent 9fbc861fa4
commit e80e4e6fd2
2 changed files with 20 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ import type { IGrammar, StackElement, IOnigLib, IRawTheme } from 'vscode-textmat
import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IValidGrammarDefinition, IValidEmbeddedLanguagesMap, IValidTokenTypeMap } from 'vs/workbench/services/textMate/common/TMScopeRegistry';
import { TMGrammarFactory } from 'vs/workbench/services/textMate/common/TMGrammarFactory';
import { missingTMGrammarErrorMessage, TMGrammarFactory } from 'vs/workbench/services/textMate/common/TMGrammarFactory';
import { IExtensionResourceLoaderService } from 'vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader';
import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress';
import { TMTokenization } from 'vs/workbench/services/textMate/common/TMTokenization';
@@ -266,6 +266,10 @@ export abstract class AbstractTextMateService extends Disposable implements ITex
});
return new TMTokenizationSupportWithLineLimit(languageId, encodedLanguageId, tokenization, this._configurationService);
} catch (err) {
if (err.message && err.message === missingTMGrammarErrorMessage) {
// Don't log this error message
return null;
}
onUnexpectedError(err);
return null;
}