From f4431d2acc8e5dd25ed41c0c8af97050a7a230d1 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 1 Feb 2020 13:12:39 +0100 Subject: [VSCode] Fix syntax highlighting Fixes #2969 --- editors/code/src/color_theme.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editors/code/src/color_theme.ts b/editors/code/src/color_theme.ts index cbad47f35..e4d20490b 100644 --- a/editors/code/src/color_theme.ts +++ b/editors/code/src/color_theme.ts @@ -28,7 +28,9 @@ export class ColorTheme { static fromRules(rules: TextMateRule[]): ColorTheme { const res = new ColorTheme(); 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; for (const scope of scopes) { -- cgit v1.2.3 From 5c39311f9639543fe1dd2a67ec5aff757bb830eb Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 1 Feb 2020 13:39:04 +0100 Subject: Fix seedrandom in packaged extension Fixes #2971 --- editors/code/src/highlighting.ts | 3 +-- editors/code/tsconfig.json | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) 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 @@ import * as vscode from 'vscode'; import * as lc from 'vscode-languageclient'; -import * as seedrandom_ from 'seedrandom'; -const seedrandom = seedrandom_; // https://github.com/jvandemo/generator-angular2-library/issues/221#issuecomment-355945207 +import seedrandom from 'seedrandom'; import { ColorTheme, TextMateRuleSettings } from './color_theme'; 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 @@ "noUnusedParameters": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "newLine": "LF" + "newLine": "LF", + "esModuleInterop": true, }, "exclude": [ "node_modules" -- cgit v1.2.3 From c84897bfb76b833122ee418d26e9bc53b4245ce8 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 1 Feb 2020 13:41:11 +0100 Subject: Tsfmt --- editors/code/src/color_theme.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editors/code/src/color_theme.ts b/editors/code/src/color_theme.ts index e4d20490b..d816f617d 100644 --- a/editors/code/src/color_theme.ts +++ b/editors/code/src/color_theme.ts @@ -31,8 +31,8 @@ export class ColorTheme { const scopes = typeof rule.scope === 'undefined' ? [] : typeof rule.scope === 'string' - ? [rule.scope] - : rule.scope; + ? [rule.scope] + : rule.scope; for (const scope of scopes) { res.rules.set(scope, rule.settings); } -- cgit v1.2.3