diff --git a/src/common/index.ts b/src/common/index.ts index 48c0809..95fb007 100644 --- a/src/common/index.ts +++ b/src/common/index.ts @@ -104,7 +104,7 @@ export function loadConfiguration( {}, ...grammars.filter((x) => x.language).map((x) => ({ [x.language || '']: x.scopeName })) ) - let extToLang = Object.assign({}, ...ys.map((x: any) => x.extensions.map((e: any) => ({ [e]: x.id }))).flat()) + let extToLang = Object.assign({}, ...ys.map((x: any) => (x.extensions || []).map((e: any) => ({ [e]: x.id }))).flat()) extensionToScope = (ext) => scope || langToScope[extToLang[ext]] } return { grammars, extensionToScope }