Add a schema to extensions, to prevent installing extensions on too old of a Zed version (#9599)

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
Max Brunsfeld
2024-03-20 17:33:26 -04:00
committed by GitHub
co-authored by Marshall
parent b1feeb9f29
commit 585e8671e3
22 changed files with 165 additions and 44 deletions
+5 -2
View File
@@ -54,7 +54,7 @@ impl HttpClientWithUrl {
}
/// Builds a Zed API URL using the given path.
pub fn build_zed_api_url(&self, path: &str) -> String {
pub fn build_zed_api_url(&self, path: &str, query: &[(&str, &str)]) -> Result<Url> {
let base_url = self.base_url();
let base_api_url = match base_url.as_ref() {
"https://zed.dev" => "https://api.zed.dev",
@@ -63,7 +63,10 @@ impl HttpClientWithUrl {
other => other,
};
format!("{}{}", base_api_url, path)
Ok(Url::parse_with_params(
&format!("{}{}", base_api_url, path),
query,
)?)
}
}