[VSCode] Fix syntax highlighting

Fixes #2969
This commit is contained in:
bjorn3 2020-02-01 13:12:39 +01:00
parent fc0a8c14dc
commit f4431d2acc

View file

@ -28,7 +28,9 @@ export class ColorTheme {
static fromRules(rules: TextMateRule[]): ColorTheme { static fromRules(rules: TextMateRule[]): ColorTheme {
const res = new ColorTheme(); const res = new ColorTheme();
for (const rule of rules) { for (const rule of rules) {
const scopes = typeof rule.scope === 'string' const scopes = typeof rule.scope === 'undefined'
? []
: typeof rule.scope === 'string'
? [rule.scope] ? [rule.scope]
: rule.scope; : rule.scope;
for (const scope of scopes) { for (const scope of scopes) {