extension_cli: Include the list of what an extension provides in the generated manifest (#24295)

This PR updates the Zed extension CLI with support for populating the
`provides` field in the generated extension manifest.

This field will contain the set of features that the extension provides.

For example:

```
"provides": ["themes", "icon-themes"]
```

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-02-05 13:17:19 -05:00 committed by GitHub
parent aaf432fcd2
commit 5a25751521
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 81 additions and 12 deletions

View file

@ -1,3 +1,5 @@
use std::collections::BTreeSet;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
@ -11,6 +13,22 @@ pub struct ExtensionApiManifest {
pub repository: String,
pub schema_version: Option<i32>,
pub wasm_api_version: Option<String>,
#[serde(default)]
pub provides: BTreeSet<ExtensionProvides>,
}
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum ExtensionProvides {
Themes,
IconThemes,
Languages,
Grammars,
LanguageServers,
ContextServers,
SlashCommands,
IndexedDocsProviders,
Snippets,
}
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)]