aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/code/src/scopes.ts18
1 files changed, 10 insertions, 8 deletions
diff --git a/editors/code/src/scopes.ts b/editors/code/src/scopes.ts
index f98b57452..1229f0fb9 100644
--- a/editors/code/src/scopes.ts
+++ b/editors/code/src/scopes.ts
@@ -42,18 +42,20 @@ export function load() {
42 } 42 }
43} 43}
44 44
45function filterThemeExtensions(extension: vscode.Extension<any>): boolean { 45
46 return (
47 extension.extensionKind === vscode.ExtensionKind.UI &&
48 extension.packageJSON.contributes &&
49 extension.packageJSON.contributes.themes
50 );
51}
52 46
53// Find current theme on disk 47// Find current theme on disk
54function loadThemeNamed(themeName: string) { 48function loadThemeNamed(themeName: string) {
49 function isTheme(extension: vscode.Extension<any>): boolean {
50 return (
51 extension.extensionKind === vscode.ExtensionKind.UI &&
52 extension.packageJSON.contributes &&
53 extension.packageJSON.contributes.themes
54 );
55 }
56
55 const themePaths = vscode.extensions.all 57 const themePaths = vscode.extensions.all
56 .filter(filterThemeExtensions) 58 .filter(isTheme)
57 .reduce((list, extension) => { 59 .reduce((list, extension) => {
58 return extension.packageJSON.contributes.themes 60 return extension.packageJSON.contributes.themes
59 .filter( 61 .filter(