zed_extension_api: Add HttpRequestBuilder (#16165)

This PR adds an `HttpRequestBuilder` to the extension API to allow for a
more ergonomic way for constructing HTTP requests within extensions.

The HTTP client functionality is now also exposed via the
`zed_extension_api::http_client` module instead of top-level.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-08-13 11:12:10 -04:00 committed by GitHub
parent 0dbecee03f
commit 8a9c58e515
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 125 additions and 34 deletions

View file

@ -1,6 +1,6 @@
//! The Zed Rust Extension API allows you write extensions for [Zed](https://zed.dev/) in Rust.
/// Provides access to Zed settings.
pub mod http_client;
pub mod settings;
use core::fmt;
@ -19,10 +19,6 @@ pub use wit::{
github_release_by_tag_name, latest_github_release, GithubRelease, GithubReleaseAsset,
GithubReleaseOptions,
},
zed::extension::http_client::{
fetch, fetch_stream, HttpMethod, HttpRequest, HttpResponse, HttpResponseStream,
RedirectPolicy,
},
zed::extension::nodejs::{
node_binary_path, npm_install_package, npm_package_installed_version,
npm_package_latest_version,