mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-13 00:17:15 +00:00
Remove trivial helpers
This commit is contained in:
parent
8346bdc04d
commit
6561634c68
1 changed files with 3 additions and 15 deletions
|
@ -82,9 +82,9 @@ function loadThemeNamed(themeName: string) {
|
|||
|
||||
function loadThemeFile(themePath: string) {
|
||||
const themeContent = [themePath]
|
||||
.filter(isFile)
|
||||
.map(readFileText)
|
||||
.map(parseJSON)
|
||||
.filter(it => fs.statSync(it).isFile())
|
||||
.map(it => fs.readFileSync(it, 'utf8'))
|
||||
.map(it => jsonc.parse(it))
|
||||
.filter(theme => theme);
|
||||
|
||||
themeContent
|
||||
|
@ -132,15 +132,3 @@ function loadColors(textMateRules: TextMateRule[]): void {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function isFile(filePath: string): boolean {
|
||||
return [filePath].map(fs.statSync).every(stat => stat.isFile());
|
||||
}
|
||||
|
||||
function readFileText(filePath: string): string {
|
||||
return fs.readFileSync(filePath, 'utf8');
|
||||
}
|
||||
|
||||
function parseJSON(content: string): any {
|
||||
return jsonc.parse(content);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue