Restore HTTP client transition, but use reqwest everywhere (#19055)

Release Notes:

- N/A
This commit is contained in:
Mikayla Maki 2024-10-11 14:58:58 -07:00 committed by GitHub
parent c709b66f35
commit 22ac178f9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 838 additions and 418 deletions

View file

@ -24,9 +24,9 @@ use gpui::{
UpdateGlobal as _, VisualContext,
};
use http_client::{read_proxy_from_env, Uri};
use isahc_http_client::IsahcHttpClient;
use language::LanguageRegistry;
use log::LevelFilter;
use reqwest_client::ReqwestClient;
use assets::Assets;
use node_runtime::{NodeBinaryOptions, NodeRuntime};
@ -335,9 +335,7 @@ fn main() {
log::info!("========== starting zed ==========");
let app = App::new()
.with_assets(Assets)
.with_http_client(IsahcHttpClient::new(None, None));
let app = App::new().with_assets(Assets);
let system_id = app.background_executor().block(system_id()).ok();
let installation_id = app.background_executor().block(installation_id()).ok();
@ -471,8 +469,9 @@ fn main() {
.ok()
})
.or_else(read_proxy_from_env);
let http = IsahcHttpClient::new(proxy_url, Some(user_agent));
cx.set_http_client(http);
let http = ReqwestClient::proxy_and_user_agent(proxy_url, &user_agent)
.expect("could not start HTTP client");
cx.set_http_client(Arc::new(http));
<dyn Fs>::set_global(fs.clone(), cx);