mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 05:38:46 +00:00
Reduce scope
This commit is contained in:
parent
96de8076ff
commit
cfb0865929
1 changed files with 10 additions and 8 deletions
|
@ -42,18 +42,20 @@ export function load() {
|
|||
}
|
||||
}
|
||||
|
||||
function filterThemeExtensions(extension: vscode.Extension<any>): boolean {
|
||||
return (
|
||||
extension.extensionKind === vscode.ExtensionKind.UI &&
|
||||
extension.packageJSON.contributes &&
|
||||
extension.packageJSON.contributes.themes
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Find current theme on disk
|
||||
function loadThemeNamed(themeName: string) {
|
||||
function isTheme(extension: vscode.Extension<any>): boolean {
|
||||
return (
|
||||
extension.extensionKind === vscode.ExtensionKind.UI &&
|
||||
extension.packageJSON.contributes &&
|
||||
extension.packageJSON.contributes.themes
|
||||
);
|
||||
}
|
||||
|
||||
const themePaths = vscode.extensions.all
|
||||
.filter(filterThemeExtensions)
|
||||
.filter(isTheme)
|
||||
.reduce((list, extension) => {
|
||||
return extension.packageJSON.contributes.themes
|
||||
.filter(
|
||||
|
|
Loading…
Reference in a new issue