mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 20:35:09 +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
|
// Find current theme on disk
|
||||||
function loadThemeNamed(themeName: string) {
|
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
|
const themePaths = vscode.extensions.all
|
||||||
.filter(filterThemeExtensions)
|
.filter(isTheme)
|
||||||
.reduce((list, extension) => {
|
.reduce((list, extension) => {
|
||||||
return extension.packageJSON.contributes.themes
|
return extension.packageJSON.contributes.themes
|
||||||
.filter(
|
.filter(
|
||||||
|
|
Loading…
Reference in a new issue