aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-31 01:30:43 +0000
committerAleksey Kladov <[email protected]>2019-12-31 01:30:43 +0000
commitcfb086592995a54828f23734a260d387db9ea926 (patch)
treed8e231311467175f46dd604a21240d56aa6d39db
parent96de8076ff50096a0ae62c5eb7a2e9c77971b552 (diff)
Reduce scope
-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(