Skip to content

Commit fd314b1

Browse files
authored
Handle comma-delimited scopes in JSON themes (#3814)
1 parent ea52c76 commit fd314b1

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Extension/src/LanguageServer/colorization.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,6 @@ export class ColorizationSettings {
245245
themeContent = plist.parse(themeContentText);
246246
if (themeContent) {
247247
textMateRules = themeContent.settings;
248-
249-
// Convert comma delimited scopes into an array, to match the json format
250-
textMateRules.forEach(e => {
251-
if (e.scope && e.scope.includes(',')) {
252-
e.scope = e.scope.split(',').map((s: string) => s.trim());
253-
}
254-
});
255248
}
256249
} else {
257250
themeContent = jsonc.parse(themeContentText);
@@ -270,6 +263,13 @@ export class ColorizationSettings {
270263
}
271264

272265
if (textMateRules) {
266+
// Convert comma delimited scopes into an array
267+
textMateRules.forEach(e => {
268+
if (e.scope && e.scope.includes(',')) {
269+
e.scope = e.scope.split(',').map((s: string) => s.trim());
270+
}
271+
});
272+
273273
let scopelessSetting: any = textMateRules.find(e => e.settings && !e.scope);
274274
if (scopelessSetting) {
275275
if (scopelessSetting.settings.background) {

0 commit comments

Comments
 (0)