aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-02-01 14:34:04 +0000
committerGitHub <[email protected]>2020-02-01 14:34:04 +0000
commit8e0ad99832dec632621b09f626552a88506e43b0 (patch)
treec7819a0f8507eb5fef4fce54a8cd412ea57fc01d /editors/code
parentfc0a8c14dcc6404c5d2ebb76488d6ebd894926c8 (diff)
parentc84897bfb76b833122ee418d26e9bc53b4245ce8 (diff)
Merge #2970
2970: [VSCode] Fix syntax highlighting r=matklad a=bjorn3 Fixes #2969 Fixes #2971 Co-authored-by: bjorn3 <[email protected]>
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/src/color_theme.ts8
-rw-r--r--editors/code/src/highlighting.ts3
-rw-r--r--editors/code/tsconfig.json3
3 files changed, 8 insertions, 6 deletions
diff --git a/editors/code/src/color_theme.ts b/editors/code/src/color_theme.ts
index cbad47f35..d816f617d 100644
--- a/editors/code/src/color_theme.ts
+++ b/editors/code/src/color_theme.ts
@@ -28,9 +28,11 @@ export class ColorTheme {
28 static fromRules(rules: TextMateRule[]): ColorTheme { 28 static fromRules(rules: TextMateRule[]): ColorTheme {
29 const res = new ColorTheme(); 29 const res = new ColorTheme();
30 for (const rule of rules) { 30 for (const rule of rules) {
31 const scopes = typeof rule.scope === 'string' 31 const scopes = typeof rule.scope === 'undefined'
32 ? [rule.scope] 32 ? []
33 : rule.scope; 33 : typeof rule.scope === 'string'
34 ? [rule.scope]
35 : rule.scope;
34 for (const scope of scopes) { 36 for (const scope of scopes) {
35 res.rules.set(scope, rule.settings); 37 res.rules.set(scope, rule.settings);
36 } 38 }
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts
index 014e96f75..fc7cd5a1c 100644
--- a/editors/code/src/highlighting.ts
+++ b/editors/code/src/highlighting.ts
@@ -1,7 +1,6 @@
1import * as vscode from 'vscode'; 1import * as vscode from 'vscode';
2import * as lc from 'vscode-languageclient'; 2import * as lc from 'vscode-languageclient';
3import * as seedrandom_ from 'seedrandom'; 3import seedrandom from 'seedrandom';
4const seedrandom = seedrandom_; // https://github.com/jvandemo/generator-angular2-library/issues/221#issuecomment-355945207
5 4
6import { ColorTheme, TextMateRuleSettings } from './color_theme'; 5import { ColorTheme, TextMateRuleSettings } from './color_theme';
7 6
diff --git a/editors/code/tsconfig.json b/editors/code/tsconfig.json
index e60eb8e5e..1ea433961 100644
--- a/editors/code/tsconfig.json
+++ b/editors/code/tsconfig.json
@@ -13,7 +13,8 @@
13 "noUnusedParameters": true, 13 "noUnusedParameters": true,
14 "noImplicitReturns": true, 14 "noImplicitReturns": true,
15 "noFallthroughCasesInSwitch": true, 15 "noFallthroughCasesInSwitch": true,
16 "newLine": "LF" 16 "newLine": "LF",
17 "esModuleInterop": true,
17 }, 18 },
18 "exclude": [ 19 "exclude": [
19 "node_modules" 20 "node_modules"