collab: Add the ability to filter extensions by what they provide (#24315)

This PR adds the ability to filter extension results from the extension
API by the features that they provide.

For instance, to filter down just to extensions that provide icon
themes:

```
https://api.zed.dev/extensions?provides=icon-themes
```

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-02-05 17:12:18 -05:00 committed by GitHub
parent c0dd7e8367
commit e1919b4121
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 85 additions and 11 deletions

View file

@ -1,8 +1,9 @@
use std::collections::BTreeSet;
use std::sync::Arc;
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use strum::EnumString;
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)]
pub struct ExtensionApiManifest {
@ -17,8 +18,11 @@ pub struct ExtensionApiManifest {
pub provides: BTreeSet<ExtensionProvides>,
}
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Serialize, Deserialize)]
#[derive(
Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Serialize, Deserialize, EnumString,
)]
#[serde(rename_all = "kebab-case")]
#[strum(serialize_all = "kebab-case")]
pub enum ExtensionProvides {
Themes,
IconThemes,