Add infrastructure for loading icon themes from extensions (#23203)

This PR adds the supporting infrastructure to support loading icon
themes defined by extensions.

Here's an example icon theme:

```json
{
  "name": "My Icon Theme",
  "author": "Me <me@example.com>",
  "themes": [
    {
      "name": "My Icon Theme",
      "appearance": "dark",
      "file_icons": {
        "gleam": { "path": "./icons/file_type_gleam.svg" },
        "toml": { "path": "./icons/file_type_toml.svg" }
      }
    }
  ]
}
```

The icon paths are resolved relative to the root of the extension
directory.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-01-15 18:33:47 -05:00 committed by GitHub
parent 3b8a5c9647
commit f53915c711
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 303 additions and 10 deletions

View file

@ -70,6 +70,8 @@ pub struct ExtensionManifest {
#[serde(default)]
pub themes: Vec<PathBuf>,
#[serde(default)]
pub icon_themes: Vec<PathBuf>,
#[serde(default)]
pub languages: Vec<PathBuf>,
#[serde(default)]
pub grammars: BTreeMap<Arc<str>, GrammarManifestEntry>,
@ -199,6 +201,7 @@ fn manifest_from_old_manifest(
themes.dedup();
themes
},
icon_themes: Vec::new(),
languages: {
let mut languages = manifest_json.languages.into_values().collect::<Vec<_>>();
languages.sort();