Skip to content

Commit 8e0ad99

Browse files
bors[bot]bjorn3
andauthored
Merge #2970
2970: [VSCode] Fix syntax highlighting r=matklad a=bjorn3 Fixes #2969 Fixes #2971 Co-authored-by: bjorn3 <[email protected]>
2 parents fc0a8c1 + c84897b commit 8e0ad99

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

editors/code/src/color_theme.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ export class ColorTheme {
2828
static fromRules(rules: TextMateRule[]): ColorTheme {
2929
const res = new ColorTheme();
3030
for (const rule of rules) {
31-
const scopes = typeof rule.scope === 'string'
32-
? [rule.scope]
33-
: rule.scope;
31+
const scopes = typeof rule.scope === 'undefined'
32+
? []
33+
: typeof rule.scope === 'string'
34+
? [rule.scope]
35+
: rule.scope;
3436
for (const scope of scopes) {
3537
res.rules.set(scope, rule.settings);
3638
}

editors/code/src/highlighting.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as vscode from 'vscode';
22
import * as lc from 'vscode-languageclient';
3-
import * as seedrandom_ from 'seedrandom';
4-
const seedrandom = seedrandom_; // https://github.com/jvandemo/generator-angular2-library/issues/221#issuecomment-355945207
3+
import seedrandom from 'seedrandom';
54

65
import { ColorTheme, TextMateRuleSettings } from './color_theme';
76

editors/code/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"noUnusedParameters": true,
1414
"noImplicitReturns": true,
1515
"noFallthroughCasesInSwitch": true,
16-
"newLine": "LF"
16+
"newLine": "LF",
17+
"esModuleInterop": true,
1718
},
1819
"exclude": [
1920
"node_modules"

0 commit comments

Comments
 (0)