mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 20:35:09 +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) {
|
function loadThemeFile(themePath: string) {
|
||||||
const themeContent = [themePath]
|
const themeContent = [themePath]
|
||||||
.filter(isFile)
|
.filter(it => fs.statSync(it).isFile())
|
||||||
.map(readFileText)
|
.map(it => fs.readFileSync(it, 'utf8'))
|
||||||
.map(parseJSON)
|
.map(it => jsonc.parse(it))
|
||||||
.filter(theme => theme);
|
.filter(theme => theme);
|
||||||
|
|
||||||
themeContent
|
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