mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-06 10:42:08 +00:00
73 lines
2 KiB
Rust
73 lines
2 KiB
Rust
|
use collections::BTreeMap;
|
||
|
use language::LanguageServerName;
|
||
|
use serde::{Deserialize, Serialize};
|
||
|
use std::{path::PathBuf, sync::Arc};
|
||
|
|
||
|
/// This is the old version of the extension manifest, from when it was `extension.json`.
|
||
|
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
|
||
|
pub struct OldExtensionManifest {
|
||
|
pub name: String,
|
||
|
pub version: Arc<str>,
|
||
|
|
||
|
#[serde(default)]
|
||
|
pub description: Option<String>,
|
||
|
#[serde(default)]
|
||
|
pub repository: Option<String>,
|
||
|
#[serde(default)]
|
||
|
pub authors: Vec<String>,
|
||
|
|
||
|
#[serde(default)]
|
||
|
pub themes: BTreeMap<Arc<str>, PathBuf>,
|
||
|
#[serde(default)]
|
||
|
pub languages: BTreeMap<Arc<str>, PathBuf>,
|
||
|
#[serde(default)]
|
||
|
pub grammars: BTreeMap<Arc<str>, PathBuf>,
|
||
|
}
|
||
|
|
||
|
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
|
||
|
pub struct ExtensionManifest {
|
||
|
pub id: Arc<str>,
|
||
|
pub name: String,
|
||
|
pub version: Arc<str>,
|
||
|
|
||
|
#[serde(default)]
|
||
|
pub description: Option<String>,
|
||
|
#[serde(default)]
|
||
|
pub repository: Option<String>,
|
||
|
#[serde(default)]
|
||
|
pub authors: Vec<String>,
|
||
|
#[serde(default)]
|
||
|
pub lib: LibManifestEntry,
|
||
|
|
||
|
#[serde(default)]
|
||
|
pub themes: Vec<PathBuf>,
|
||
|
#[serde(default)]
|
||
|
pub languages: Vec<PathBuf>,
|
||
|
#[serde(default)]
|
||
|
pub grammars: BTreeMap<Arc<str>, GrammarManifestEntry>,
|
||
|
#[serde(default)]
|
||
|
pub language_servers: BTreeMap<LanguageServerName, LanguageServerManifestEntry>,
|
||
|
}
|
||
|
|
||
|
#[derive(Clone, Default, PartialEq, Eq, Debug, Deserialize, Serialize)]
|
||
|
pub struct LibManifestEntry {
|
||
|
pub kind: Option<ExtensionLibraryKind>,
|
||
|
}
|
||
|
|
||
|
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
|
||
|
pub enum ExtensionLibraryKind {
|
||
|
Rust,
|
||
|
}
|
||
|
|
||
|
#[derive(Clone, Default, PartialEq, Eq, Debug, Deserialize, Serialize)]
|
||
|
pub struct GrammarManifestEntry {
|
||
|
pub repository: String,
|
||
|
#[serde(alias = "commit")]
|
||
|
pub rev: String,
|
||
|
}
|
||
|
|
||
|
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
|
||
|
pub struct LanguageServerManifestEntry {
|
||
|
pub language: Arc<str>,
|
||
|
}
|