aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-31 01:21:57 +0000
committerAleksey Kladov <[email protected]>2019-12-31 01:21:57 +0000
commit6561634c687cad2d1b7041b45b618d1c336f2e68 (patch)
tree01ab98903c3c54926ef5254143efef6af7bda18a /editors
parent8346bdc04d5bbaad133c6377bf8863a2d298d55a (diff)
Remove trivial helpers
Diffstat (limited to 'editors')
-rw-r--r--editors/code/src/scopes.ts18
1 files changed, 3 insertions, 15 deletions
diff --git a/editors/code/src/scopes.ts b/editors/code/src/scopes.ts
index cb250b853..465556333 100644
--- a/editors/code/src/scopes.ts
+++ b/editors/code/src/scopes.ts
@@ -82,9 +82,9 @@ function loadThemeNamed(themeName: string) {
82 82
83function loadThemeFile(themePath: string) { 83function loadThemeFile(themePath: string) {
84 const themeContent = [themePath] 84 const themeContent = [themePath]
85 .filter(isFile) 85 .filter(it => fs.statSync(it).isFile())
86 .map(readFileText) 86 .map(it => fs.readFileSync(it, 'utf8'))
87 .map(parseJSON) 87 .map(it => jsonc.parse(it))
88 .filter(theme => theme); 88 .filter(theme => theme);
89 89
90 themeContent 90 themeContent
@@ -132,15 +132,3 @@ function loadColors(textMateRules: TextMateRule[]): void {
132 } 132 }
133 }); 133 });
134} 134}
135
136function isFile(filePath: string): boolean {
137 return [filePath].map(fs.statSync).every(stat => stat.isFile());
138}
139
140function readFileText(filePath: string): string {
141 return fs.readFileSync(filePath, 'utf8');
142}
143
144function parseJSON(content: string): any {
145 return jsonc.parse(content);
146}