Skip to content

Commit

Permalink
Merge pull request #48 from so1ve/patch-1
Browse files Browse the repository at this point in the history
fix: allow `extensions` to be undefined
  • Loading branch information
PanAeon authored Feb 5, 2024
2 parents f648445 + d9d9fc1 commit 8146c88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 8146c88

Please sign in to comment.