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 14:33:26 -07:00 committed by GitHub
parent b1feeb9f29
commit 585e8671e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 165 additions and 44 deletions

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,
)?)
}
}