diff --git a/Cargo.lock b/Cargo.lock index 71ed0c038f..714d14ff70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -248,7 +248,7 @@ version = "0.1.0" dependencies = [ "anyhow", "futures 0.3.28", - "http 0.1.0", + "http_client", "isahc", "schemars", "serde", @@ -392,7 +392,7 @@ dependencies = [ "gpui", "heed", "html_to_markdown 0.1.0", - "http 0.1.0", + "http_client", "indexed_docs", "indoc", "language", @@ -955,7 +955,7 @@ dependencies = [ "db", "editor", "gpui", - "http 0.1.0", + "http_client", "isahc", "log", "markdown_preview", @@ -1876,7 +1876,7 @@ dependencies = [ "fs", "futures 0.3.28", "gpui", - "http 0.1.0", + "http_client", "language", "live_kit_client", "log", @@ -2104,7 +2104,7 @@ dependencies = [ "collections", "futures 0.3.28", "gpui", - "http 0.1.0", + "http_client", "language", "log", "rand 0.8.5", @@ -2315,8 +2315,7 @@ dependencies = [ "fs", "futures 0.3.28", "gpui", - "http 0.1.0", - "isahc", + "http_client", "lazy_static", "log", "once_cell", @@ -2434,7 +2433,7 @@ dependencies = [ "gpui", "headless", "hex", - "http 0.1.0", + "http_client", "indoc", "language", "language_model", @@ -2507,7 +2506,7 @@ dependencies = [ "futures 0.3.28", "fuzzy", "gpui", - "http 0.1.0", + "http_client", "language", "lazy_static", "menu", @@ -2704,7 +2703,7 @@ dependencies = [ "fs", "futures 0.3.28", "gpui", - "http 0.1.0", + "http_client", "indoc", "language", "lsp", @@ -3537,7 +3536,7 @@ dependencies = [ "fuzzy", "git", "gpui", - "http 0.1.0", + "http_client", "indoc", "itertools 0.11.0", "language", @@ -3860,7 +3859,7 @@ dependencies = [ "fs", "futures 0.3.28", "gpui", - "http 0.1.0", + "http_client", "indexed_docs", "isahc", "language", @@ -3901,7 +3900,7 @@ dependencies = [ "env_logger", "extension", "fs", - "http 0.1.0", + "http_client", "language", "log", "rpc", @@ -4019,7 +4018,7 @@ dependencies = [ "editor", "futures 0.3.28", "gpui", - "http 0.1.0", + "http_client", "human_bytes", "isahc", "language", @@ -4624,7 +4623,7 @@ dependencies = [ "derive_more", "git2", "gpui", - "http 0.1.0", + "http_client", "lazy_static", "log", "parking_lot", @@ -4664,7 +4663,7 @@ dependencies = [ "futures 0.3.28", "git", "gpui", - "http 0.1.0", + "http_client", "isahc", "pretty_assertions", "regex", @@ -4748,7 +4747,7 @@ version = "0.1.0" dependencies = [ "anyhow", "futures 0.3.28", - "http 0.1.0", + "http_client", "serde", "serde_json", ] @@ -4818,7 +4817,7 @@ dependencies = [ "foreign-types 0.5.0", "futures 0.3.28", "gpui_macros", - "http 0.1.0", + "http_client", "image", "itertools 0.11.0", "lazy_static", @@ -5180,21 +5179,6 @@ dependencies = [ "regex", ] -[[package]] -name = "http" -version = "0.1.0" -dependencies = [ - "anyhow", - "derive_more", - "futures 0.3.28", - "futures-lite 1.13.0", - "isahc", - "log", - "serde", - "serde_json", - "url", -] - [[package]] name = "http" version = "0.2.9" @@ -5234,6 +5218,22 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" +[[package]] +name = "http_client" +version = "0.1.0" +dependencies = [ + "anyhow", + "derive_more", + "futures 0.3.28", + "futures-lite 1.13.0", + "http 1.0.0", + "isahc", + "log", + "serde", + "serde_json", + "url", +] + [[package]] name = "httparse" version = "1.8.0" @@ -5437,7 +5437,7 @@ dependencies = [ "gpui", "heed", "html_to_markdown 0.1.0", - "http 0.1.0", + "http_client", "indexmap 1.9.3", "indoc", "parking_lot", @@ -5877,7 +5877,7 @@ dependencies = [ "git", "globset", "gpui", - "http 0.1.0", + "http_client", "indoc", "itertools 0.11.0", "lazy_static", @@ -5929,7 +5929,7 @@ dependencies = [ "feature_flags", "futures 0.3.28", "gpui", - "http 0.1.0", + "http_client", "language", "log", "menu", @@ -6004,7 +6004,7 @@ dependencies = [ "feature_flags", "futures 0.3.28", "gpui", - "http 0.1.0", + "http_client", "language", "lazy_static", "log", @@ -6771,7 +6771,7 @@ dependencies = [ "async-trait", "async_zip", "futures 0.3.28", - "http 0.1.0", + "http_client", "log", "paths", "semver", @@ -7110,7 +7110,7 @@ version = "0.1.0" dependencies = [ "anyhow", "futures 0.3.28", - "http 0.1.0", + "http_client", "isahc", "schemars", "serde", @@ -7181,7 +7181,7 @@ version = "0.1.0" dependencies = [ "anyhow", "futures 0.3.28", - "http 0.1.0", + "http_client", "isahc", "schemars", "serde", @@ -7986,7 +7986,7 @@ dependencies = [ "git2", "globset", "gpui", - "http 0.1.0", + "http_client", "itertools 0.11.0", "language", "log", @@ -8631,7 +8631,7 @@ dependencies = [ "fs", "futures 0.3.28", "gpui", - "http 0.1.0", + "http_client", "language", "log", "node_runtime", @@ -8679,7 +8679,7 @@ dependencies = [ "env_logger", "futures 0.3.28", "gpui", - "http 0.1.0", + "http_client", "image", "language", "log", @@ -9438,7 +9438,7 @@ dependencies = [ "futures-batch", "gpui", "heed", - "http 0.1.0", + "http_client", "language", "languages", "log", @@ -10395,7 +10395,7 @@ dependencies = [ "env_logger", "futures 0.3.28", "gpui", - "http 0.1.0", + "http_client", "language", "log", "postage", @@ -10417,7 +10417,7 @@ version = "0.1.0" dependencies = [ "anyhow", "futures 0.3.28", - "http 0.1.0", + "http_client", "paths", "serde", "serde_json", @@ -10827,7 +10827,7 @@ dependencies = [ "ctor", "env_logger", "gpui", - "http 0.1.0", + "http_client", "lazy_static", "log", "parking_lot", @@ -11093,7 +11093,7 @@ dependencies = [ "extensions_ui", "feedback", "gpui", - "http 0.1.0", + "http_client", "notifications", "pretty_assertions", "project", @@ -13320,7 +13320,7 @@ dependencies = [ "fs", "futures 0.3.28", "gpui", - "http 0.1.0", + "http_client", "itertools 0.11.0", "language", "lazy_static", @@ -13357,7 +13357,7 @@ dependencies = [ "git", "git2", "gpui", - "http 0.1.0", + "http_client", "ignore", "language", "log", @@ -13646,7 +13646,7 @@ dependencies = [ "go_to_line", "gpui", "headless", - "http 0.1.0", + "http_client", "image_viewer", "inline_completion_button", "install_cli", diff --git a/Cargo.toml b/Cargo.toml index 95d17adef9..a0732591be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ members = [ "crates/gpui_macros", "crates/headless", "crates/html_to_markdown", - "crates/http", + "crates/http_client", "crates/image_viewer", "crates/indexed_docs", "crates/inline_completion_button", @@ -167,6 +167,7 @@ assets = { path = "crates/assets" } assistant = { path = "crates/assistant" } assistant_slash_command = { path = "crates/assistant_slash_command" } assistant_tooling = { path = "crates/assistant_tooling" } +async-tungstenite = { version = "0.23" } audio = { path = "crates/audio" } auto_update = { path = "crates/auto_update" } breadcrumbs = { path = "crates/breadcrumbs" } @@ -203,7 +204,7 @@ gpui = { path = "crates/gpui" } gpui_macros = { path = "crates/gpui_macros" } headless = { path = "crates/headless" } html_to_markdown = { path = "crates/html_to_markdown" } -http = { path = "crates/http" } +http_client = { path = "crates/http_client" } image_viewer = { path = "crates/image_viewer" } indexed_docs = { path = "crates/indexed_docs" } inline_completion_button = { path = "crates/inline_completion_button" } diff --git a/crates/anthropic/Cargo.toml b/crates/anthropic/Cargo.toml index 0ea24d5c07..2d7da211a4 100644 --- a/crates/anthropic/Cargo.toml +++ b/crates/anthropic/Cargo.toml @@ -18,7 +18,7 @@ path = "src/anthropic.rs" [dependencies] anyhow.workspace = true futures.workspace = true -http.workspace = true +http_client.workspace = true isahc.workspace = true schemars = { workspace = true, optional = true } serde.workspace = true diff --git a/crates/anthropic/src/anthropic.rs b/crates/anthropic/src/anthropic.rs index 62f796cf25..d6efdff779 100644 --- a/crates/anthropic/src/anthropic.rs +++ b/crates/anthropic/src/anthropic.rs @@ -1,6 +1,6 @@ use anyhow::{anyhow, Result}; use futures::{io::BufReader, stream::BoxStream, AsyncBufReadExt, AsyncReadExt, StreamExt}; -use http::{AsyncBody, HttpClient, Method, Request as HttpRequest}; +use http_client::{AsyncBody, HttpClient, Method, Request as HttpRequest}; use isahc::config::Configurable; use serde::{Deserialize, Serialize}; use std::{convert::TryFrom, time::Duration}; diff --git a/crates/assistant/Cargo.toml b/crates/assistant/Cargo.toml index 4c371377f4..a284b289a8 100644 --- a/crates/assistant/Cargo.toml +++ b/crates/assistant/Cargo.toml @@ -41,7 +41,7 @@ fuzzy.workspace = true gpui.workspace = true heed.workspace = true html_to_markdown.workspace = true -http.workspace = true +http_client.workspace = true indexed_docs.workspace = true indoc.workspace = true language.workspace = true diff --git a/crates/assistant/src/slash_command/fetch_command.rs b/crates/assistant/src/slash_command/fetch_command.rs index c99bf438fb..8934d68c16 100644 --- a/crates/assistant/src/slash_command/fetch_command.rs +++ b/crates/assistant/src/slash_command/fetch_command.rs @@ -10,7 +10,7 @@ use assistant_slash_command::{ use futures::AsyncReadExt; use gpui::{AppContext, Task, WeakView}; use html_to_markdown::{convert_html_to_markdown, markdown, TagHandler}; -use http::{AsyncBody, HttpClient, HttpClientWithUrl}; +use http_client::{AsyncBody, HttpClient, HttpClientWithUrl}; use language::LspAdapterDelegate; use ui::prelude::*; use workspace::Workspace; diff --git a/crates/auto_update/Cargo.toml b/crates/auto_update/Cargo.toml index 105758a7ce..12e669780d 100644 --- a/crates/auto_update/Cargo.toml +++ b/crates/auto_update/Cargo.toml @@ -18,7 +18,7 @@ client.workspace = true db.workspace = true editor.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true isahc.workspace = true log.workspace = true markdown_preview.workspace = true diff --git a/crates/auto_update/src/auto_update.rs b/crates/auto_update/src/auto_update.rs index bbeb2319e6..b6868f5643 100644 --- a/crates/auto_update/src/auto_update.rs +++ b/crates/auto_update/src/auto_update.rs @@ -20,7 +20,7 @@ use smol::{fs, io::AsyncReadExt}; use settings::{Settings, SettingsSources, SettingsStore}; use smol::{fs::File, process::Command}; -use http::{HttpClient, HttpClientWithUrl}; +use http_client::{HttpClient, HttpClientWithUrl}; use release_channel::{AppCommitSha, AppVersion, ReleaseChannel}; use std::{ env::{ diff --git a/crates/call/Cargo.toml b/crates/call/Cargo.toml index 70249eb533..468d381258 100644 --- a/crates/call/Cargo.toml +++ b/crates/call/Cargo.toml @@ -51,4 +51,4 @@ language = { workspace = true, features = ["test-support"] } live_kit_client = { workspace = true, features = ["test-support"] } project = { workspace = true, features = ["test-support"] } util = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } diff --git a/crates/channel/Cargo.toml b/crates/channel/Cargo.toml index 5aed4a629d..77179eea93 100644 --- a/crates/channel/Cargo.toml +++ b/crates/channel/Cargo.toml @@ -40,4 +40,4 @@ rpc = { workspace = true, features = ["test-support"] } client = { workspace = true, features = ["test-support"] } settings = { workspace = true, features = ["test-support"] } util = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } diff --git a/crates/channel/src/channel_store_tests.rs b/crates/channel/src/channel_store_tests.rs index 2dd3c0f81d..1cf9fa706d 100644 --- a/crates/channel/src/channel_store_tests.rs +++ b/crates/channel/src/channel_store_tests.rs @@ -4,7 +4,7 @@ use super::*; use client::{test::FakeServer, Client, UserStore}; use clock::FakeSystemClock; use gpui::{AppContext, Context, Model, SemanticVersion, TestAppContext}; -use http::FakeHttpClient; +use http_client::FakeHttpClient; use rpc::proto::{self}; use settings::SettingsStore; diff --git a/crates/client/Cargo.toml b/crates/client/Cargo.toml index 579e3297f6..387cc94a93 100644 --- a/crates/client/Cargo.toml +++ b/crates/client/Cargo.toml @@ -18,7 +18,7 @@ test-support = ["clock/test-support", "collections/test-support", "gpui/test-sup [dependencies] anyhow.workspace = true async-recursion = "0.3" -async-tungstenite = { version = "0.23", features = ["async-std", "async-native-tls"] } +async-tungstenite = { workspace = true, features = ["async-std", "async-native-tls"] } chrono = { workspace = true, features = ["serde"] } clock.workspace = true collections.workspace = true @@ -26,7 +26,7 @@ feature_flags.workspace = true fs.workspace = true futures.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true lazy_static.workspace = true log.workspace = true once_cell.workspace = true @@ -60,12 +60,11 @@ gpui = { workspace = true, features = ["test-support"] } rpc = { workspace = true, features = ["test-support"] } settings = { workspace = true, features = ["test-support"] } util = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } [target.'cfg(target_os = "windows")'.dependencies] windows.workspace = true [target.'cfg(target_os = "macos")'.dependencies] cocoa.workspace = true -isahc = { workspace = true, features = ["static-curl"] } async-native-tls = { version = "0.5.0", features = ["vendored"] } diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs index 99d05cb146..8c309f6846 100644 --- a/crates/client/src/client.rs +++ b/crates/client/src/client.rs @@ -20,7 +20,7 @@ use futures::{ use gpui::{ actions, AnyModel, AnyWeakModel, AppContext, AsyncAppContext, Global, Model, Task, WeakModel, }; -use http::{HttpClient, HttpClientWithUrl}; +use http_client::{AsyncBody, HttpClient, HttpClientWithUrl}; use lazy_static::lazy_static; use parking_lot::RwLock; use postage::watch; @@ -233,7 +233,7 @@ pub enum EstablishConnectionError { #[error("{0}")] Other(#[from] anyhow::Error), #[error("{0}")] - Http(#[from] http::Error), + Http(#[from] http_client::Error), #[error("{0}")] Io(#[from] std::io::Error), #[error("{0}")] @@ -1351,7 +1351,7 @@ impl Client { let mut url = self.rpc_url(http.clone(), None).await?; url.set_path("/user"); url.set_query(Some(&format!("github_login={login}"))); - let request = Request::get(url.as_str()) + let request: http_client::Request = Request::get(url.as_str()) .header("Authorization", format!("token {api_token}")) .body("".into())?; @@ -1783,7 +1783,7 @@ mod tests { use clock::FakeSystemClock; use gpui::{BackgroundExecutor, Context, TestAppContext}; - use http::FakeHttpClient; + use http_client::FakeHttpClient; use parking_lot::Mutex; use proto::TypedEnvelope; use settings::SettingsStore; diff --git a/crates/client/src/telemetry.rs b/crates/client/src/telemetry.rs index 55f263f42e..e648c90032 100644 --- a/crates/client/src/telemetry.rs +++ b/crates/client/src/telemetry.rs @@ -6,7 +6,7 @@ use clock::SystemClock; use collections::{HashMap, HashSet}; use futures::Future; use gpui::{AppContext, BackgroundExecutor, Task}; -use http::{self, HttpClient, HttpClientWithUrl, Method}; +use http_client::{self, HttpClient, HttpClientWithUrl, Method}; use once_cell::sync::Lazy; use parking_lot::Mutex; use release_channel::ReleaseChannel; @@ -632,7 +632,7 @@ impl Telemetry { let checksum = calculate_json_checksum(&json_bytes).unwrap_or("".to_string()); - let request = http::Request::builder() + let request = http_client::Request::builder() .method(Method::POST) .uri( this.http_client @@ -661,7 +661,7 @@ mod tests { use chrono::TimeZone; use clock::FakeSystemClock; use gpui::TestAppContext; - use http::FakeHttpClient; + use http_client::FakeHttpClient; #[gpui::test] fn test_telemetry_flush_on_max_queue_size(cx: &mut TestAppContext) { diff --git a/crates/collab/Cargo.toml b/crates/collab/Cargo.toml index a0f3cdc294..54fe12fab0 100644 --- a/crates/collab/Cargo.toml +++ b/crates/collab/Cargo.toml @@ -20,7 +20,7 @@ test-support = ["sqlite"] [dependencies] anthropic.workspace = true anyhow.workspace = true -async-tungstenite = "0.23" +async-tungstenite.workspace = true aws-config = { version = "1.1.5" } aws-sdk-s3 = { version = "1.15.0" } axum = { version = "0.6", features = ["json", "headers", "ws"] } @@ -35,7 +35,7 @@ envy = "0.4.2" futures.workspace = true google_ai.workspace = true hex.workspace = true -http.workspace = true +http_client.workspace = true live_kit_server.workspace = true log.workspace = true nanoid.workspace = true diff --git a/crates/collab/src/rpc.rs b/crates/collab/src/rpc.rs index 0ee3b8d64b..75f7e4941d 100644 --- a/crates/collab/src/rpc.rs +++ b/crates/collab/src/rpc.rs @@ -42,7 +42,7 @@ use futures::{ stream::FuturesUnordered, FutureExt, SinkExt, StreamExt, TryStreamExt, }; -use http::IsahcHttpClient; +use http_client::IsahcHttpClient; use prometheus::{register_int_gauge, IntGauge}; use rpc::{ proto::{ diff --git a/crates/collab/src/tests/test_server.rs b/crates/collab/src/tests/test_server.rs index 423455ea0b..88beedd35e 100644 --- a/crates/collab/src/tests/test_server.rs +++ b/crates/collab/src/tests/test_server.rs @@ -19,7 +19,7 @@ use fs::FakeFs; use futures::{channel::oneshot, StreamExt as _}; use git::GitHostingProviderRegistry; use gpui::{BackgroundExecutor, Context, Model, Task, TestAppContext, View, VisualTestContext}; -use http::FakeHttpClient; +use http_client::FakeHttpClient; use language::LanguageRegistry; use node_runtime::FakeNodeRuntime; use notifications::NotificationStore; diff --git a/crates/collab_ui/Cargo.toml b/crates/collab_ui/Cargo.toml index 6bfcca832b..0333a96961 100644 --- a/crates/collab_ui/Cargo.toml +++ b/crates/collab_ui/Cargo.toml @@ -25,7 +25,7 @@ test-support = [ "settings/test-support", "util/test-support", "workspace/test-support", - "http/test-support", + "http_client/test-support", ] [dependencies] @@ -80,5 +80,5 @@ rpc = { workspace = true, features = ["test-support"] } settings = { workspace = true, features = ["test-support"] } tree-sitter-markdown.workspace = true util = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } workspace = { workspace = true, features = ["test-support"] } diff --git a/crates/copilot/Cargo.toml b/crates/copilot/Cargo.toml index 70915ecab2..0fc3067eab 100644 --- a/crates/copilot/Cargo.toml +++ b/crates/copilot/Cargo.toml @@ -32,7 +32,7 @@ command_palette_hooks.workspace = true editor.workspace = true futures.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true language.workspace = true lsp.workspace = true menu.workspace = true @@ -65,4 +65,4 @@ rpc = { workspace = true, features = ["test-support"] } settings = { workspace = true, features = ["test-support"] } theme = { workspace = true, features = ["test-support"] } util = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } diff --git a/crates/copilot/src/copilot.rs b/crates/copilot/src/copilot.rs index 0a81475e33..71a0679e66 100644 --- a/crates/copilot/src/copilot.rs +++ b/crates/copilot/src/copilot.rs @@ -12,8 +12,8 @@ use gpui::{ actions, AppContext, AsyncAppContext, Context, Entity, EntityId, EventEmitter, Global, Model, ModelContext, Task, WeakModel, }; -use http::github::latest_github_release; -use http::HttpClient; +use http_client::github::latest_github_release; +use http_client::HttpClient; use language::{ language_settings::{all_language_settings, language_settings, InlineCompletionProvider}, point_from_lsp, point_to_lsp, Anchor, Bias, Buffer, BufferSnapshot, Language, PointUtf16, @@ -393,7 +393,7 @@ impl Copilot { Default::default(), cx.to_async(), ); - let http = http::FakeHttpClient::create(|_| async { unreachable!() }); + let http = http_client::FakeHttpClient::create(|_| async { unreachable!() }); let node_runtime = FakeNodeRuntime::new(); let this = cx.new_model(|cx| Self { server_id: LanguageServerId(0), diff --git a/crates/editor/Cargo.toml b/crates/editor/Cargo.toml index dae32ff582..ab0a77c1de 100644 --- a/crates/editor/Cargo.toml +++ b/crates/editor/Cargo.toml @@ -43,7 +43,7 @@ futures.workspace = true fuzzy.workspace = true git.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true indoc.workspace = true itertools.workspace = true language.workspace = true @@ -98,4 +98,4 @@ tree-sitter-typescript.workspace = true unindent.workspace = true util = { workspace = true, features = ["test-support"] } workspace = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } diff --git a/crates/editor/src/git/blame.rs b/crates/editor/src/git/blame.rs index a7dac9c3f5..59dbbd6a9e 100644 --- a/crates/editor/src/git/blame.rs +++ b/crates/editor/src/git/blame.rs @@ -7,7 +7,7 @@ use git::{ parse_git_remote_url, GitHostingProvider, GitHostingProviderRegistry, Oid, PullRequest, }; use gpui::{Model, ModelContext, Subscription, Task}; -use http::HttpClient; +use http_client::HttpClient; use language::{markdown, Bias, Buffer, BufferSnapshot, Edit, LanguageRegistry, ParsedMarkdown}; use multi_buffer::MultiBufferRow; use project::{Item, Project}; diff --git a/crates/extension/Cargo.toml b/crates/extension/Cargo.toml index 8320681c73..075292f450 100644 --- a/crates/extension/Cargo.toml +++ b/crates/extension/Cargo.toml @@ -27,7 +27,7 @@ collections.workspace = true fs.workspace = true futures.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true indexed_docs.workspace = true isahc.workspace = true language.workspace = true diff --git a/crates/extension/src/extension_builder.rs b/crates/extension/src/extension_builder.rs index d1928b884d..1324c5d2ac 100644 --- a/crates/extension/src/extension_builder.rs +++ b/crates/extension/src/extension_builder.rs @@ -6,7 +6,7 @@ use async_compression::futures::bufread::GzipDecoder; use async_tar::Archive; use futures::io::BufReader; use futures::AsyncReadExt; -use http::{self, AsyncBody, HttpClient}; +use http_client::{self, AsyncBody, HttpClient}; use serde::Deserialize; use std::{ env, fs, mem, diff --git a/crates/extension/src/extension_store.rs b/crates/extension/src/extension_store.rs index 882c79d803..316c32832a 100644 --- a/crates/extension/src/extension_store.rs +++ b/crates/extension/src/extension_store.rs @@ -33,7 +33,7 @@ use gpui::{ actions, AppContext, AsyncAppContext, Context, EventEmitter, Global, Model, ModelContext, Task, WeakModel, }; -use http::{AsyncBody, HttpClient, HttpClientWithUrl}; +use http_client::{AsyncBody, HttpClient, HttpClientWithUrl}; use indexed_docs::{IndexedDocsRegistry, ProviderId}; use language::{ LanguageConfig, LanguageMatcher, LanguageQueries, LanguageRegistry, QUERY_FILENAME_PREFIXES, @@ -244,7 +244,7 @@ impl ExtensionStore { installed_dir, index_path, builder: Arc::new(ExtensionBuilder::new( - http::client(http_client.proxy().cloned()), + ::http_client::client(http_client.proxy().cloned()), build_dir, )), outstanding_operations: Default::default(), diff --git a/crates/extension/src/extension_store_test.rs b/crates/extension/src/extension_store_test.rs index d975e2ca90..61e6bc3eec 100644 --- a/crates/extension/src/extension_store_test.rs +++ b/crates/extension/src/extension_store_test.rs @@ -11,7 +11,7 @@ use collections::BTreeMap; use fs::{FakeFs, Fs, RealFs}; use futures::{io::BufReader, AsyncReadExt, StreamExt}; use gpui::{Context, SemanticVersion, TestAppContext}; -use http::{FakeHttpClient, Response}; +use http_client::{FakeHttpClient, Response}; use indexed_docs::IndexedDocsRegistry; use language::{LanguageMatcher, LanguageRegistry, LanguageServerBinaryStatus, LanguageServerName}; use node_runtime::FakeNodeRuntime; diff --git a/crates/extension/src/wasm_host.rs b/crates/extension/src/wasm_host.rs index 8e982be8cd..d8afe520a1 100644 --- a/crates/extension/src/wasm_host.rs +++ b/crates/extension/src/wasm_host.rs @@ -13,7 +13,7 @@ use futures::{ Future, FutureExt, StreamExt as _, }; use gpui::{AppContext, AsyncAppContext, BackgroundExecutor, Task}; -use http::HttpClient; +use http_client::HttpClient; use language::LanguageRegistry; use node_runtime::NodeRuntime; use release_channel::ReleaseChannel; diff --git a/crates/extension/src/wasm_host/wit/since_v0_0_7.rs b/crates/extension/src/wasm_host/wit/since_v0_0_7.rs index c610f66917..faf238b0fa 100644 --- a/crates/extension/src/wasm_host/wit/since_v0_0_7.rs +++ b/crates/extension/src/wasm_host/wit/since_v0_0_7.rs @@ -1,4 +1,5 @@ use crate::wasm_host::{wit::ToWasmtimeResult, WasmState}; +use ::http_client::AsyncBody; use ::settings::Settings; use anyhow::{anyhow, bail, Context, Result}; use async_compression::futures::bufread::GzipDecoder; @@ -6,7 +7,6 @@ use async_tar::Archive; use async_trait::async_trait; use futures::AsyncReadExt; use futures::{io::BufReader, FutureExt as _}; -use http::AsyncBody; use indexed_docs::IndexedDocsDatabase; use language::{ language_settings::AllLanguageSettings, LanguageServerBinaryStatus, LspAdapterDelegate, @@ -209,8 +209,8 @@ impl nodejs::Host for WasmState { #[async_trait] impl lsp::Host for WasmState {} -impl From for github::GithubRelease { - fn from(value: http::github::GithubRelease) -> Self { +impl From<::http_client::github::GithubRelease> for github::GithubRelease { + fn from(value: ::http_client::github::GithubRelease) -> Self { Self { version: value.tag_name, assets: value.assets.into_iter().map(Into::into).collect(), @@ -218,8 +218,8 @@ impl From for github::GithubRelease { } } -impl From for github::GithubReleaseAsset { - fn from(value: http::github::GithubReleaseAsset) -> Self { +impl From<::http_client::github::GithubReleaseAsset> for github::GithubReleaseAsset { + fn from(value: ::http_client::github::GithubReleaseAsset) -> Self { Self { name: value.name, download_url: value.browser_download_url, @@ -235,7 +235,7 @@ impl github::Host for WasmState { options: github::GithubReleaseOptions, ) -> wasmtime::Result> { maybe!(async { - let release = http::github::latest_github_release( + let release = ::http_client::github::latest_github_release( &repo, options.require_assets, options.pre_release, @@ -254,9 +254,12 @@ impl github::Host for WasmState { tag: String, ) -> wasmtime::Result> { maybe!(async { - let release = - http::github::get_release_by_tag_name(&repo, &tag, self.host.http_client.clone()) - .await?; + let release = ::http_client::github::get_release_by_tag_name( + &repo, + &tag, + self.host.http_client.clone(), + ) + .await?; Ok(release.into()) }) .await diff --git a/crates/extension_cli/Cargo.toml b/crates/extension_cli/Cargo.toml index 6beb8f3408..54c47f4a82 100644 --- a/crates/extension_cli/Cargo.toml +++ b/crates/extension_cli/Cargo.toml @@ -18,7 +18,7 @@ clap = { workspace = true, features = ["derive"] } env_logger.workspace = true extension = { workspace = true, features = ["no-webrtc"] } fs.workspace = true -http.workspace = true +http_client.workspace = true language.workspace = true log.workspace = true rpc.workspace = true diff --git a/crates/extension_cli/src/main.rs b/crates/extension_cli/src/main.rs index 11b79b8677..71bf095b1b 100644 --- a/crates/extension_cli/src/main.rs +++ b/crates/extension_cli/src/main.rs @@ -7,13 +7,13 @@ use std::{ }; use ::fs::{copy_recursive, CopyOptions, Fs, RealFs}; +use ::http_client::HttpClientWithProxy; use anyhow::{anyhow, bail, Context, Result}; use clap::Parser; use extension::{ extension_builder::{CompileExtensionOptions, ExtensionBuilder}, ExtensionManifest, }; -use http::HttpClientWithProxy; use language::LanguageConfig; use theme::ThemeRegistry; use tree_sitter::{Language, Query, WasmStore}; diff --git a/crates/feedback/Cargo.toml b/crates/feedback/Cargo.toml index d6d46a5fb6..83c726e3e9 100644 --- a/crates/feedback/Cargo.toml +++ b/crates/feedback/Cargo.toml @@ -24,7 +24,7 @@ futures.workspace = true gpui.workspace = true human_bytes = "0.4.1" isahc.workspace = true -http.workspace = true +http_client.workspace = true language.workspace = true log.workspace = true menu.workspace = true diff --git a/crates/feedback/src/feedback_modal.rs b/crates/feedback/src/feedback_modal.rs index d59dac0697..370d8b73c4 100644 --- a/crates/feedback/src/feedback_modal.rs +++ b/crates/feedback/src/feedback_modal.rs @@ -10,7 +10,7 @@ use gpui::{ div, rems, AppContext, DismissEvent, EventEmitter, FocusHandle, FocusableView, Model, PromptLevel, Render, Task, View, ViewContext, }; -use http::HttpClient; +use http_client::HttpClient; use isahc::Request; use language::Buffer; use project::Project; diff --git a/crates/git/Cargo.toml b/crates/git/Cargo.toml index e281c580ac..6c606dd2db 100644 --- a/crates/git/Cargo.toml +++ b/crates/git/Cargo.toml @@ -19,7 +19,7 @@ collections.workspace = true derive_more.workspace = true git2.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true lazy_static.workspace = true log.workspace = true parking_lot.workspace = true diff --git a/crates/git/src/hosting_provider.rs b/crates/git/src/hosting_provider.rs index e373190b5c..7be132a67e 100644 --- a/crates/git/src/hosting_provider.rs +++ b/crates/git/src/hosting_provider.rs @@ -5,7 +5,7 @@ use async_trait::async_trait; use collections::BTreeMap; use derive_more::{Deref, DerefMut}; use gpui::{AppContext, Global}; -use http::HttpClient; +use http_client::HttpClient; use parking_lot::RwLock; use url::Url; diff --git a/crates/git_hosting_providers/Cargo.toml b/crates/git_hosting_providers/Cargo.toml index 833393099c..caca91c1ab 100644 --- a/crates/git_hosting_providers/Cargo.toml +++ b/crates/git_hosting_providers/Cargo.toml @@ -17,7 +17,7 @@ async-trait.workspace = true futures.workspace = true git.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true isahc.workspace = true regex.workspace = true serde.workspace = true diff --git a/crates/git_hosting_providers/src/providers/codeberg.rs b/crates/git_hosting_providers/src/providers/codeberg.rs index 4f9ada226e..b34d809100 100644 --- a/crates/git_hosting_providers/src/providers/codeberg.rs +++ b/crates/git_hosting_providers/src/providers/codeberg.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use anyhow::{bail, Context, Result}; use async_trait::async_trait; use futures::AsyncReadExt; -use http::HttpClient; +use http_client::HttpClient; use isahc::config::Configurable; use isahc::{AsyncBody, Request}; use serde::Deserialize; diff --git a/crates/git_hosting_providers/src/providers/github.rs b/crates/git_hosting_providers/src/providers/github.rs index f27fc9e0a7..103f6ae1ce 100644 --- a/crates/git_hosting_providers/src/providers/github.rs +++ b/crates/git_hosting_providers/src/providers/github.rs @@ -3,7 +3,7 @@ use std::sync::{Arc, OnceLock}; use anyhow::{bail, Context, Result}; use async_trait::async_trait; use futures::AsyncReadExt; -use http::HttpClient; +use http_client::HttpClient; use isahc::config::Configurable; use isahc::{AsyncBody, Request}; use regex::Regex; diff --git a/crates/google_ai/Cargo.toml b/crates/google_ai/Cargo.toml index 86f0d13b9a..9fecd8f708 100644 --- a/crates/google_ai/Cargo.toml +++ b/crates/google_ai/Cargo.toml @@ -11,6 +11,6 @@ path = "src/google_ai.rs" [dependencies] anyhow.workspace = true futures.workspace = true -http.workspace = true +http_client.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/crates/google_ai/src/google_ai.rs b/crates/google_ai/src/google_ai.rs index 6a9b37cb43..34c43176d0 100644 --- a/crates/google_ai/src/google_ai.rs +++ b/crates/google_ai/src/google_ai.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use anyhow::{anyhow, Result}; use futures::{io::BufReader, stream::BoxStream, AsyncBufReadExt, AsyncReadExt, StreamExt}; -use http::HttpClient; +use http_client::HttpClient; use serde::{Deserialize, Serialize}; pub const API_URL: &str = "https://generativelanguage.googleapis.com"; diff --git a/crates/gpui/Cargo.toml b/crates/gpui/Cargo.toml index 429e74509b..049acded99 100644 --- a/crates/gpui/Cargo.toml +++ b/crates/gpui/Cargo.toml @@ -16,7 +16,7 @@ test-support = [ "backtrace", "collections/test-support", "util/test-support", - "http/test-support", + "http_client/test-support", ] runtime_shaders = [] macos-blade = ["blade-graphics", "blade-macros", "blade-util", "bytemuck"] @@ -41,7 +41,7 @@ etagere = "0.2" futures.workspace = true font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "40391b7" } gpui_macros.workspace = true -http.workspace = true +http_client.workspace = true image = "0.25.1" itertools.workspace = true lazy_static.workspace = true @@ -79,7 +79,7 @@ waker-fn = "1.1.0" backtrace = "0.3" collections = { workspace = true, features = ["test-support"] } util = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } unicode-segmentation.workspace = true [build-dependencies] diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs index 4dde1f8f10..627c76572a 100644 --- a/crates/gpui/src/app.rs +++ b/crates/gpui/src/app.rs @@ -18,7 +18,7 @@ use smol::future::FutureExt; pub use async_context::*; use collections::{FxHashMap, FxHashSet, VecDeque}; pub use entity_map::*; -use http::{self, HttpClient}; +use http_client::HttpClient; pub use model_context::*; #[cfg(any(test, feature = "test-support"))] pub use test_context::*; @@ -114,7 +114,7 @@ impl App { Self(AppContext::new( current_platform(false), Arc::new(()), - http::client(None), + http_client::client(None), )) } @@ -125,7 +125,7 @@ impl App { Self(AppContext::new( current_platform(true), Arc::new(()), - http::client(None), + http_client::client(None), )) } diff --git a/crates/gpui/src/app/test_context.rs b/crates/gpui/src/app/test_context.rs index 944a95501d..95f0698855 100644 --- a/crates/gpui/src/app/test_context.rs +++ b/crates/gpui/src/app/test_context.rs @@ -104,7 +104,7 @@ impl TestAppContext { let foreground_executor = ForegroundExecutor::new(arc_dispatcher); let platform = TestPlatform::new(background_executor.clone(), foreground_executor.clone()); let asset_source = Arc::new(()); - let http_client = http::FakeHttpClient::with_404_response(); + let http_client = http_client::FakeHttpClient::with_404_response(); let text_system = Arc::new(TextSystem::new(platform.text_system())); Self { diff --git a/crates/gpui/src/elements/img.rs b/crates/gpui/src/elements/img.rs index 916a83df91..c47ed69ac0 100644 --- a/crates/gpui/src/elements/img.rs +++ b/crates/gpui/src/elements/img.rs @@ -13,7 +13,7 @@ use image::{ImageBuffer, ImageError}; #[cfg(target_os = "macos")] use media::core_video::CVImageBuffer; -use http; +use http_client; use thiserror::Error; use util::ResultExt; @@ -413,7 +413,7 @@ impl Asset for Image { pub enum ImageCacheError { /// An error that occurred while fetching an image from a remote source. #[error("http error: {0}")] - Client(#[from] http::Error), + Client(#[from] http_client::Error), /// An error that occurred while reading the image from disk. #[error("IO error: {0}")] Io(Arc), @@ -423,7 +423,7 @@ pub enum ImageCacheError { /// The URI of the image. uri: SharedUri, /// The HTTP status code. - status: http::StatusCode, + status: http_client::StatusCode, /// The HTTP response body. body: String, }, diff --git a/crates/gpui/src/platform/linux/wayland/client.rs b/crates/gpui/src/platform/linux/wayland/client.rs index c88f0ff761..c97fe24f39 100644 --- a/crates/gpui/src/platform/linux/wayland/client.rs +++ b/crates/gpui/src/platform/linux/wayland/client.rs @@ -11,7 +11,7 @@ use calloop_wayland_source::WaylandSource; use collections::HashMap; use filedescriptor::Pipe; -use http::Url; +use http_client::Url; use smallvec::SmallVec; use util::ResultExt; use wayland_backend::client::ObjectId; diff --git a/crates/http/Cargo.toml b/crates/http_client/Cargo.toml similarity index 86% rename from crates/http/Cargo.toml rename to crates/http_client/Cargo.toml index 41a12084eb..ae017685a9 100644 --- a/crates/http/Cargo.toml +++ b/crates/http_client/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "http" +name = "http_client" version = "0.1.0" edition = "2021" publish = false @@ -12,10 +12,11 @@ workspace = true test-support = [] [lib] -path = "src/http.rs" +path = "src/http_client.rs" doctest = true [dependencies] +http = "1.0.0" anyhow.workspace = true derive_more.workspace = true futures.workspace = true diff --git a/crates/http/LICENSE-APACHE b/crates/http_client/LICENSE-APACHE similarity index 100% rename from crates/http/LICENSE-APACHE rename to crates/http_client/LICENSE-APACHE diff --git a/crates/http/src/github.rs b/crates/http_client/src/github.rs similarity index 100% rename from crates/http/src/github.rs rename to crates/http_client/src/github.rs diff --git a/crates/http/src/http.rs b/crates/http_client/src/http_client.rs similarity index 100% rename from crates/http/src/http.rs rename to crates/http_client/src/http_client.rs diff --git a/crates/indexed_docs/Cargo.toml b/crates/indexed_docs/Cargo.toml index e1609116d1..2c71484e7f 100644 --- a/crates/indexed_docs/Cargo.toml +++ b/crates/indexed_docs/Cargo.toml @@ -22,7 +22,7 @@ fuzzy.workspace = true gpui.workspace = true heed.workspace = true html_to_markdown.workspace = true -http.workspace = true +http_client.workspace = true indexmap.workspace = true parking_lot.workspace = true paths.workspace = true diff --git a/crates/indexed_docs/src/providers/rustdoc.rs b/crates/indexed_docs/src/providers/rustdoc.rs index 9509725a1a..4e27792e79 100644 --- a/crates/indexed_docs/src/providers/rustdoc.rs +++ b/crates/indexed_docs/src/providers/rustdoc.rs @@ -13,7 +13,7 @@ use async_trait::async_trait; use collections::{HashSet, VecDeque}; use fs::Fs; use futures::{AsyncReadExt, FutureExt}; -use http::{AsyncBody, HttpClient, HttpClientWithUrl}; +use http_client::{AsyncBody, HttpClient, HttpClientWithUrl}; use crate::{IndexedDocsDatabase, IndexedDocsProvider, PackageName, ProviderId}; diff --git a/crates/language/Cargo.toml b/crates/language/Cargo.toml index a9b9394d18..9e15684052 100644 --- a/crates/language/Cargo.toml +++ b/crates/language/Cargo.toml @@ -35,7 +35,7 @@ fuzzy.workspace = true git.workspace = true globset.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true itertools.workspace = true lazy_static.workspace = true log.workspace = true @@ -84,4 +84,4 @@ tree-sitter-rust.workspace = true tree-sitter-typescript.workspace = true unindent.workspace = true util = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } diff --git a/crates/language/src/language.rs b/crates/language/src/language.rs index 7b2e4916f3..c07090fd95 100644 --- a/crates/language/src/language.rs +++ b/crates/language/src/language.rs @@ -27,7 +27,7 @@ use collections::{HashMap, HashSet}; use futures::Future; use gpui::{AppContext, AsyncAppContext, Model, SharedString, Task}; pub use highlight_map::HighlightMap; -use http::HttpClient; +use http_client::HttpClient; use lazy_static::lazy_static; use lsp::{CodeActionKind, LanguageServerBinary}; use parking_lot::Mutex; diff --git a/crates/language_model/Cargo.toml b/crates/language_model/Cargo.toml index 1324676120..1a099897a3 100644 --- a/crates/language_model/Cargo.toml +++ b/crates/language_model/Cargo.toml @@ -29,7 +29,7 @@ editor.workspace = true feature_flags.workspace = true futures.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true menu.workspace = true ollama = { workspace = true, features = ["schemars"] } open_ai = { workspace = true, features = ["schemars"] } diff --git a/crates/language_model/src/provider/anthropic.rs b/crates/language_model/src/provider/anthropic.rs index facdfb21ac..620c99017b 100644 --- a/crates/language_model/src/provider/anthropic.rs +++ b/crates/language_model/src/provider/anthropic.rs @@ -7,7 +7,7 @@ use gpui::{ AnyView, AppContext, AsyncAppContext, FontStyle, Subscription, Task, TextStyle, View, WhiteSpace, }; -use http::HttpClient; +use http_client::HttpClient; use settings::{Settings, SettingsStore}; use std::{sync::Arc, time::Duration}; use strum::IntoEnumIterator; diff --git a/crates/language_model/src/provider/fake.rs b/crates/language_model/src/provider/fake.rs index bcd46a6fdd..81261bbe64 100644 --- a/crates/language_model/src/provider/fake.rs +++ b/crates/language_model/src/provider/fake.rs @@ -8,7 +8,7 @@ use crate::{ LanguageModelProviderName, LanguageModelProviderState, LanguageModelRequest, }; use gpui::{AnyView, AppContext, AsyncAppContext, Task}; -use http::Result; +use http_client::Result; use ui::WindowContext; pub fn language_model_id() -> LanguageModelId { diff --git a/crates/language_model/src/provider/ollama.rs b/crates/language_model/src/provider/ollama.rs index 47a3c3731d..4dd0f4dcb1 100644 --- a/crates/language_model/src/provider/ollama.rs +++ b/crates/language_model/src/provider/ollama.rs @@ -1,7 +1,7 @@ use anyhow::{anyhow, Result}; use futures::{future::BoxFuture, stream::BoxStream, FutureExt, StreamExt}; use gpui::{AnyView, AppContext, AsyncAppContext, ModelContext, Subscription, Task}; -use http::HttpClient; +use http_client::HttpClient; use ollama::{get_models, stream_chat_completion, ChatMessage, ChatOptions, ChatRequest}; use settings::{Settings, SettingsStore}; use std::{sync::Arc, time::Duration}; diff --git a/crates/language_model/src/provider/open_ai.rs b/crates/language_model/src/provider/open_ai.rs index b82df4ca48..8135f4e941 100644 --- a/crates/language_model/src/provider/open_ai.rs +++ b/crates/language_model/src/provider/open_ai.rs @@ -6,7 +6,7 @@ use gpui::{ AnyView, AppContext, AsyncAppContext, FontStyle, Subscription, Task, TextStyle, View, WhiteSpace, }; -use http::HttpClient; +use http_client::HttpClient; use open_ai::{stream_completion, Request, RequestMessage}; use settings::{Settings, SettingsStore}; use std::{sync::Arc, time::Duration}; diff --git a/crates/languages/Cargo.toml b/crates/languages/Cargo.toml index 502440e10c..f1ecaf8d61 100644 --- a/crates/languages/Cargo.toml +++ b/crates/languages/Cargo.toml @@ -20,7 +20,7 @@ collections.workspace = true feature_flags.workspace = true futures.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true language.workspace = true lazy_static.workspace = true log.workspace = true diff --git a/crates/languages/src/c.rs b/crates/languages/src/c.rs index cc70435c57..ea11b4e0d0 100644 --- a/crates/languages/src/c.rs +++ b/crates/languages/src/c.rs @@ -2,7 +2,7 @@ use anyhow::{anyhow, bail, Context, Result}; use async_trait::async_trait; use futures::StreamExt; use gpui::AsyncAppContext; -use http::github::{latest_github_release, GitHubLspBinaryVersion}; +use http_client::github::{latest_github_release, GitHubLspBinaryVersion}; pub use language::*; use lsp::LanguageServerBinary; use project::project_settings::{BinarySettings, ProjectSettings}; diff --git a/crates/languages/src/go.rs b/crates/languages/src/go.rs index 08c4a40ad9..5587bf652e 100644 --- a/crates/languages/src/go.rs +++ b/crates/languages/src/go.rs @@ -2,7 +2,7 @@ use anyhow::{anyhow, Context, Result}; use async_trait::async_trait; use futures::StreamExt; use gpui::{AppContext, AsyncAppContext, Task}; -use http::github::latest_github_release; +use http_client::github::latest_github_release; pub use language::*; use lazy_static::lazy_static; use lsp::LanguageServerBinary; diff --git a/crates/languages/src/json.rs b/crates/languages/src/json.rs index 9890936dba..cec63874af 100644 --- a/crates/languages/src/json.rs +++ b/crates/languages/src/json.rs @@ -6,7 +6,7 @@ use collections::HashMap; use feature_flags::FeatureFlagAppExt; use futures::StreamExt; use gpui::{AppContext, AsyncAppContext}; -use http::github::{latest_github_release, GitHubLspBinaryVersion}; +use http_client::github::{latest_github_release, GitHubLspBinaryVersion}; use language::{LanguageRegistry, LanguageServerName, LspAdapter, LspAdapterDelegate}; use lsp::LanguageServerBinary; use node_runtime::NodeRuntime; diff --git a/crates/languages/src/rust.rs b/crates/languages/src/rust.rs index 5fb4f8046f..ebf1d0d0e3 100644 --- a/crates/languages/src/rust.rs +++ b/crates/languages/src/rust.rs @@ -3,7 +3,7 @@ use async_compression::futures::bufread::GzipDecoder; use async_trait::async_trait; use futures::{io::BufReader, StreamExt}; use gpui::{AppContext, AsyncAppContext}; -use http::github::{latest_github_release, GitHubLspBinaryVersion}; +use http_client::github::{latest_github_release, GitHubLspBinaryVersion}; pub use language::*; use language_settings::all_language_settings; use lazy_static::lazy_static; diff --git a/crates/languages/src/typescript.rs b/crates/languages/src/typescript.rs index 6be2d5d82d..0f6b2bfec8 100644 --- a/crates/languages/src/typescript.rs +++ b/crates/languages/src/typescript.rs @@ -4,7 +4,7 @@ use async_tar::Archive; use async_trait::async_trait; use collections::HashMap; use gpui::AsyncAppContext; -use http::github::{build_tarball_url, GitHubLspBinaryVersion}; +use http_client::github::{build_tarball_url, GitHubLspBinaryVersion}; use language::{LanguageServerName, LspAdapter, LspAdapterDelegate}; use lsp::{CodeActionKind, LanguageServerBinary}; use node_runtime::NodeRuntime; diff --git a/crates/node_runtime/Cargo.toml b/crates/node_runtime/Cargo.toml index aee792f018..b7aee58336 100644 --- a/crates/node_runtime/Cargo.toml +++ b/crates/node_runtime/Cargo.toml @@ -22,7 +22,7 @@ async-tar.workspace = true async-trait.workspace = true async_zip.workspace = true futures.workspace = true -http.workspace = true +http_client.workspace = true log.workspace = true paths.workspace = true semver.workspace = true diff --git a/crates/node_runtime/src/node_runtime.rs b/crates/node_runtime/src/node_runtime.rs index 5b543b81e3..58c3f8f673 100644 --- a/crates/node_runtime/src/node_runtime.rs +++ b/crates/node_runtime/src/node_runtime.rs @@ -5,7 +5,7 @@ pub use archive::extract_zip; use async_compression::futures::bufread::GzipDecoder; use async_tar::Archive; use futures::AsyncReadExt; -use http::HttpClient; +use http_client::HttpClient; use semver::Version; use serde::Deserialize; use smol::io::BufReader; diff --git a/crates/ollama/Cargo.toml b/crates/ollama/Cargo.toml index c0ee5498ee..76a8b1a8c1 100644 --- a/crates/ollama/Cargo.toml +++ b/crates/ollama/Cargo.toml @@ -18,7 +18,7 @@ schemars = ["dep:schemars"] [dependencies] anyhow.workspace = true futures.workspace = true -http.workspace = true +http_client.workspace = true isahc.workspace = true schemars = { workspace = true, optional = true } serde.workspace = true diff --git a/crates/ollama/src/ollama.rs b/crates/ollama/src/ollama.rs index d2dfd2155d..269698ebab 100644 --- a/crates/ollama/src/ollama.rs +++ b/crates/ollama/src/ollama.rs @@ -1,6 +1,6 @@ use anyhow::{anyhow, Context, Result}; use futures::{io::BufReader, stream::BoxStream, AsyncBufReadExt, AsyncReadExt, StreamExt}; -use http::{AsyncBody, HttpClient, Method, Request as HttpRequest}; +use http_client::{AsyncBody, HttpClient, Method, Request as HttpRequest}; use isahc::config::Configurable; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; diff --git a/crates/open_ai/Cargo.toml b/crates/open_ai/Cargo.toml index eae3a306a7..76ba7c4b50 100644 --- a/crates/open_ai/Cargo.toml +++ b/crates/open_ai/Cargo.toml @@ -15,7 +15,7 @@ schemars = ["dep:schemars"] [dependencies] anyhow.workspace = true futures.workspace = true -http.workspace = true +http_client.workspace = true isahc.workspace = true schemars = { workspace = true, optional = true } serde.workspace = true diff --git a/crates/open_ai/src/open_ai.rs b/crates/open_ai/src/open_ai.rs index 56d934c5b0..dfcd6646d1 100644 --- a/crates/open_ai/src/open_ai.rs +++ b/crates/open_ai/src/open_ai.rs @@ -1,6 +1,6 @@ use anyhow::{anyhow, Context, Result}; use futures::{io::BufReader, stream::BoxStream, AsyncBufReadExt, AsyncReadExt, StreamExt}; -use http::{AsyncBody, HttpClient, Method, Request as HttpRequest}; +use http_client::{AsyncBody, HttpClient, Method, Request as HttpRequest}; use isahc::config::Configurable; use serde::{Deserialize, Serialize}; use serde_json::{Map, Value}; diff --git a/crates/project/Cargo.toml b/crates/project/Cargo.toml index 43cc001bf3..ff5fd693f2 100644 --- a/crates/project/Cargo.toml +++ b/crates/project/Cargo.toml @@ -37,7 +37,7 @@ fuzzy.workspace = true git.workspace = true globset.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true itertools.workspace = true language.workspace = true log.workspace = true diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 62a4030f34..37b7e01b25 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -39,7 +39,7 @@ use gpui::{ AnyModel, AppContext, AsyncAppContext, BackgroundExecutor, BorrowAppContext, Context, Entity, EventEmitter, Model, ModelContext, PromptLevel, SharedString, Task, WeakModel, WindowContext, }; -use http::{HttpClient, Url}; +use http_client::{HttpClient, Url}; use itertools::Itertools; use language::{ language_settings::{ @@ -1120,7 +1120,7 @@ impl Project { let fs = Arc::new(RealFs::default()); let languages = LanguageRegistry::test(cx.background_executor().clone()); let clock = Arc::new(FakeSystemClock::default()); - let http_client = http::FakeHttpClient::with_404_response(); + let http_client = http_client::FakeHttpClient::with_404_response(); let client = cx .update(|cx| client::Client::new(clock, http_client.clone(), cx)) .unwrap(); @@ -1164,7 +1164,7 @@ impl Project { let languages = LanguageRegistry::test(cx.executor()); let clock = Arc::new(FakeSystemClock::default()); - let http_client = http::FakeHttpClient::with_404_response(); + let http_client = http_client::FakeHttpClient::with_404_response(); let client = cx.update(|cx| client::Client::new(clock, http_client.clone(), cx)); let user_store = cx.new_model(|cx| UserStore::new(client.clone(), cx)); let project = cx.update(|cx| { diff --git a/crates/remote_server/Cargo.toml b/crates/remote_server/Cargo.toml index 1176a65ba4..ce38197b5f 100644 --- a/crates/remote_server/Cargo.toml +++ b/crates/remote_server/Cargo.toml @@ -42,7 +42,7 @@ client = { workspace = true, features = ["test-support"] } clock = { workspace = true, features = ["test-support"] } fs = { workspace = true, features = ["test-support"] } gpui = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } language = { workspace = true, features = ["test-support"] } node_runtime = { workspace = true, features = ["test-support"] } remote = { workspace = true, features = ["test-support"] } diff --git a/crates/remote_server/src/remote_editing_tests.rs b/crates/remote_server/src/remote_editing_tests.rs index 15589261ec..c166ff650a 100644 --- a/crates/remote_server/src/remote_editing_tests.rs +++ b/crates/remote_server/src/remote_editing_tests.rs @@ -3,7 +3,7 @@ use client::{Client, UserStore}; use clock::FakeSystemClock; use fs::{FakeFs, Fs as _}; use gpui::{Context, Model, TestAppContext}; -use http::FakeHttpClient; +use http_client::FakeHttpClient; use language::LanguageRegistry; use node_runtime::FakeNodeRuntime; use project::Project; diff --git a/crates/repl/Cargo.toml b/crates/repl/Cargo.toml index a1f74d27dc..0c98ddc2a7 100644 --- a/crates/repl/Cargo.toml +++ b/crates/repl/Cargo.toml @@ -44,7 +44,7 @@ workspace.workspace = true editor = { workspace = true, features = ["test-support"] } env_logger.workspace = true gpui = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } language = { workspace = true, features = ["test-support"] } project = { workspace = true, features = ["test-support"] } settings = { workspace = true, features = ["test-support"] } diff --git a/crates/rpc/Cargo.toml b/crates/rpc/Cargo.toml index 1872eaebf1..b5f21206cf 100644 --- a/crates/rpc/Cargo.toml +++ b/crates/rpc/Cargo.toml @@ -18,7 +18,7 @@ test-support = ["collections/test-support", "gpui/test-support", "proto/test-sup [dependencies] anyhow.workspace = true -async-tungstenite = "0.23" +async-tungstenite.workspace = true base64.workspace = true chrono.workspace = true collections.workspace = true diff --git a/crates/semantic_index/Cargo.toml b/crates/semantic_index/Cargo.toml index 19cb0c96fe..6dc12b040c 100644 --- a/crates/semantic_index/Cargo.toml +++ b/crates/semantic_index/Cargo.toml @@ -30,7 +30,7 @@ gpui.workspace = true language.workspace = true log.workspace = true heed.workspace = true -http.workspace = true +http_client.workspace = true open_ai.workspace = true parking_lot.workspace = true project.workspace = true @@ -60,4 +60,4 @@ tempfile.workspace = true util = { workspace = true, features = ["test-support"] } worktree = { workspace = true, features = ["test-support"] } workspace = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } diff --git a/crates/semantic_index/examples/index.rs b/crates/semantic_index/examples/index.rs index f994952d81..cc09375167 100644 --- a/crates/semantic_index/examples/index.rs +++ b/crates/semantic_index/examples/index.rs @@ -1,7 +1,7 @@ use client::Client; use futures::channel::oneshot; use gpui::App; -use http::HttpClientWithUrl; +use http_client::HttpClientWithUrl; use language::language_settings::AllLanguageSettings; use project::Project; use semantic_index::{OpenAiEmbeddingModel, OpenAiEmbeddingProvider, SemanticIndex}; diff --git a/crates/semantic_index/src/embedding/ollama.rs b/crates/semantic_index/src/embedding/ollama.rs index aef6780cfe..5c875ddaa6 100644 --- a/crates/semantic_index/src/embedding/ollama.rs +++ b/crates/semantic_index/src/embedding/ollama.rs @@ -1,6 +1,6 @@ use anyhow::{Context as _, Result}; use futures::{future::BoxFuture, AsyncReadExt, FutureExt}; -use http::HttpClient; +use http_client::HttpClient; use serde::{Deserialize, Serialize}; use std::sync::Arc; diff --git a/crates/semantic_index/src/embedding/open_ai.rs b/crates/semantic_index/src/embedding/open_ai.rs index ceceb4129f..d07e7d6b53 100644 --- a/crates/semantic_index/src/embedding/open_ai.rs +++ b/crates/semantic_index/src/embedding/open_ai.rs @@ -1,7 +1,7 @@ use crate::{Embedding, EmbeddingProvider, TextToEmbed}; use anyhow::Result; use futures::{future::BoxFuture, FutureExt}; -use http::HttpClient; +use http_client::HttpClient; pub use open_ai::OpenAiEmbeddingModel; use std::sync::Arc; diff --git a/crates/supermaven/Cargo.toml b/crates/supermaven/Cargo.toml index b1a6763490..af9d619a43 100644 --- a/crates/supermaven/Cargo.toml +++ b/crates/supermaven/Cargo.toml @@ -40,4 +40,4 @@ project = { workspace = true, features = ["test-support"] } settings = { workspace = true, features = ["test-support"] } theme = { workspace = true, features = ["test-support"] } util = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } diff --git a/crates/supermaven_api/Cargo.toml b/crates/supermaven_api/Cargo.toml index d06e103f2c..72ae902006 100644 --- a/crates/supermaven_api/Cargo.toml +++ b/crates/supermaven_api/Cargo.toml @@ -15,7 +15,7 @@ doctest = false [dependencies] anyhow.workspace = true futures.workspace = true -http.workspace = true +http_client.workspace = true paths.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/crates/supermaven_api/src/supermaven_api.rs b/crates/supermaven_api/src/supermaven_api.rs index 09f64b1215..b341c2c23c 100644 --- a/crates/supermaven_api/src/supermaven_api.rs +++ b/crates/supermaven_api/src/supermaven_api.rs @@ -1,7 +1,7 @@ use anyhow::{anyhow, Context, Result}; use futures::io::BufReader; use futures::{AsyncReadExt, Future}; -use http::{AsyncBody, HttpClient, Request as HttpRequest}; +use http_client::{AsyncBody, HttpClient, Request as HttpRequest}; use paths::supermaven_dir; use serde::{Deserialize, Serialize}; use smol::fs::{self, File}; diff --git a/crates/text/Cargo.toml b/crates/text/Cargo.toml index 3ac0a0bcd6..655d8f8be4 100644 --- a/crates/text/Cargo.toml +++ b/crates/text/Cargo.toml @@ -37,4 +37,4 @@ env_logger.workspace = true gpui = { workspace = true, features = ["test-support"] } rand.workspace = true util = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } diff --git a/crates/title_bar/Cargo.toml b/crates/title_bar/Cargo.toml index 919d738bd2..6c453a62e3 100644 --- a/crates/title_bar/Cargo.toml +++ b/crates/title_bar/Cargo.toml @@ -21,7 +21,7 @@ test-support = [ "collections/test-support", "editor/test-support", "gpui/test-support", - "http/test-support", + "http_client/test-support", "project/test-support", "settings/test-support", "util/test-support", @@ -61,7 +61,7 @@ client = { workspace = true, features = ["test-support"] } collections = { workspace = true, features = ["test-support"] } editor = { workspace = true, features = ["test-support"] } gpui = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } notifications = { workspace = true, features = ["test-support"] } pretty_assertions.workspace = true project = { workspace = true, features = ["test-support"] } diff --git a/crates/workspace/Cargo.toml b/crates/workspace/Cargo.toml index b2ab2b2ef7..c410846416 100644 --- a/crates/workspace/Cargo.toml +++ b/crates/workspace/Cargo.toml @@ -17,7 +17,7 @@ no-webrtc = ["call/no-webrtc"] test-support = [ "call/test-support", "client/test-support", - "http/test-support", + "http_client/test-support", "db/test-support", "project/test-support", "session/test-support", @@ -40,7 +40,7 @@ derive_more.workspace = true fs.workspace = true futures.workspace = true gpui.workspace = true -http.workspace = true +http_client.workspace = true itertools.workspace = true language.workspace = true lazy_static.workspace = true @@ -73,4 +73,4 @@ gpui = { workspace = true, features = ["test-support"] } project = { workspace = true, features = ["test-support"] } session = { workspace = true, features = ["test-support"] } settings = { workspace = true, features = ["test-support"] } -http = { workspace = true, features = ["test-support"] } +http_client = { workspace = true, features = ["test-support"] } diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index fa5e7856db..e6cbf22a6c 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -583,7 +583,7 @@ impl AppState { let fs = fs::FakeFs::new(cx.background_executor().clone()); let languages = Arc::new(LanguageRegistry::test(cx.background_executor().clone())); let clock = Arc::new(clock::FakeSystemClock::default()); - let http_client = http::FakeHttpClient::with_404_response(); + let http_client = http_client::FakeHttpClient::with_404_response(); let client = Client::new(clock, http_client.clone(), cx); let session = Session::test(); let user_store = cx.new_model(|cx| UserStore::new(client.clone(), cx)); diff --git a/crates/worktree/Cargo.toml b/crates/worktree/Cargo.toml index cbb353b9d3..2e88832031 100644 --- a/crates/worktree/Cargo.toml +++ b/crates/worktree/Cargo.toml @@ -18,7 +18,7 @@ test-support = [ "settings/test-support", "text/test-support", "gpui/test-support", - "http/test-support", + "http_client/test-support", ] [dependencies] @@ -52,7 +52,7 @@ collections = { workspace = true, features = ["test-support"] } env_logger.workspace = true git2.workspace = true gpui = {workspace = true, features = ["test-support"]} -http.workspace = true +http_client.workspace = true rand.workspace = true settings = {workspace = true, features = ["test-support"]} pretty_assertions.workspace = true diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index 8b1b7ebf1e..668c0820cd 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -49,7 +49,7 @@ git_hosting_providers.workspace = true go_to_line.workspace = true gpui.workspace = true headless.workspace = true -http.workspace = true +http_client.workspace = true image_viewer.workspace = true inline_completion_button.workspace = true install_cli.workspace = true diff --git a/crates/zed/src/reliability.rs b/crates/zed/src/reliability.rs index 958e27e933..c3747b8d7e 100644 --- a/crates/zed/src/reliability.rs +++ b/crates/zed/src/reliability.rs @@ -4,10 +4,10 @@ use chrono::Utc; use client::telemetry; use db::kvp::KEY_VALUE_STORE; use gpui::{AppContext, SemanticVersion}; -use http::Method; +use http_client::Method; use isahc::config::Configurable; -use http::{self, HttpClient, HttpClientWithUrl}; +use http_client::{self, HttpClient, HttpClientWithUrl}; use paths::{crashes_dir, crashes_retired_dir}; use release_channel::ReleaseChannel; use release_channel::RELEASE_CHANNEL; @@ -162,7 +162,7 @@ pub fn monitor_main_thread_hangs( use parking_lot::Mutex; - use http::Method; + use http_client::Method; use std::{ ffi::c_int, sync::{mpsc, OnceLock}, @@ -323,7 +323,7 @@ pub fn monitor_main_thread_hangs( continue; }; - let Ok(request) = http::Request::builder() + let Ok(request) = http_client::Request::builder() .method(Method::POST) .uri(url.as_ref()) .header("x-zed-checksum", checksum) @@ -416,7 +416,7 @@ async fn upload_previous_panics( continue; }; - let Ok(request) = http::Request::builder() + let Ok(request) = http_client::Request::builder() .method(Method::POST) .uri(panic_report_url.as_ref()) .header("x-zed-checksum", checksum) @@ -488,7 +488,7 @@ async fn upload_previous_crashes( .await .context("error reading crash file")?; - let mut request = http::Request::post(&crash_report_url.to_string()) + let mut request = http_client::Request::post(&crash_report_url.to_string()) .redirect_policy(isahc::config::RedirectPolicy::Follow) .header("Content-Type", "text/plain");