Skip to content

Commit 625a45b

Browse files
authored
Merge pull request #29 from CodinGame/fix-missing-condition
Fix missing condition
2 parents c26ddea + 0cb1f89 commit 625a45b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/languages/textMate/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ const languageService = monaco.extra.StandaloneServices.get(monaco.languages.ILa
3636
async function createTextMateTokensProvider (languageId: string): Promise<monaco.languages.ITokenizationSupport | null> {
3737
const grammarFactory = getOrCreateGrammarFactory()
3838
const encodedLanguageId = languageService.languageIdCodec.encodeLanguageId(languageId)
39+
if (!grammarFactory.has(languageId)) {
40+
return null
41+
}
3942
const { grammar, initialState, containsEmbeddedLanguages } = await grammarFactory.createGrammar(languageId, encodedLanguageId)
4043
if (grammar == null) {
4144
return null

0 commit comments

Comments
 (0)