mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 07:12:03 +03:00
Rename zed-rpc
to zrpc
Co-Authored-By: Nathan Sobo <nathan@zed.dev> Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
c4e37dc47c
commit
391ad489ff
46
Cargo.lock
generated
46
Cargo.lock
generated
@ -5834,28 +5834,7 @@ dependencies = [
|
||||
"tree-sitter-rust",
|
||||
"unindent",
|
||||
"url",
|
||||
"zed-rpc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zed-rpc"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-lock",
|
||||
"async-tungstenite",
|
||||
"base64 0.13.0",
|
||||
"futures",
|
||||
"log",
|
||||
"parking_lot",
|
||||
"postage",
|
||||
"prost 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost-build",
|
||||
"rand 0.8.3",
|
||||
"rsa",
|
||||
"serde 1.0.125",
|
||||
"smol",
|
||||
"tempdir",
|
||||
"zrpc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -5894,7 +5873,7 @@ dependencies = [
|
||||
"tide-compress",
|
||||
"toml 0.5.8",
|
||||
"zed",
|
||||
"zed-rpc",
|
||||
"zrpc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -5917,3 +5896,24 @@ dependencies = [
|
||||
"syn",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zrpc"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-lock",
|
||||
"async-tungstenite",
|
||||
"base64 0.13.0",
|
||||
"futures",
|
||||
"log",
|
||||
"parking_lot",
|
||||
"postage",
|
||||
"prost 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"prost-build",
|
||||
"rand 0.8.3",
|
||||
"rsa",
|
||||
"serde 1.0.125",
|
||||
"smol",
|
||||
"tempdir",
|
||||
]
|
||||
|
@ -1,5 +1,5 @@
|
||||
[workspace]
|
||||
members = ["fsevent", "gpui", "gpui_macros", "server", "zed", "zed-rpc"]
|
||||
members = ["fsevent", "gpui", "gpui_macros", "server", "zed", "zrpc"]
|
||||
|
||||
[patch.crates-io]
|
||||
async-task = { git = "https://github.com/zed-industries/async-task", rev = "341b57d6de98cdfd7b418567b8de2022ca993a6e" }
|
||||
|
@ -32,7 +32,7 @@ surf = "2.2.0"
|
||||
tide = "0.16.0"
|
||||
tide-compress = "0.9.0"
|
||||
toml = "0.5.8"
|
||||
zed-rpc = { path = "../zed-rpc" }
|
||||
zrpc = { path = "../zrpc" }
|
||||
|
||||
[dependencies.async-sqlx-session]
|
||||
version = "0.3.0"
|
||||
|
@ -18,7 +18,7 @@ use sqlx::FromRow;
|
||||
use std::{borrow::Cow, convert::TryFrom, sync::Arc};
|
||||
use surf::Url;
|
||||
use tide::Server;
|
||||
use zed_rpc::{auth as zed_auth, proto, Peer};
|
||||
use zrpc::{auth as zed_auth, proto, Peer};
|
||||
|
||||
static CURRENT_GITHUB_USER: &'static str = "current_github_user";
|
||||
static GITHUB_AUTH_URL: &'static str = "https://github.com/login/oauth/authorize";
|
||||
@ -124,7 +124,7 @@ impl RequestExt for Request {
|
||||
pub trait PeerExt {
|
||||
async fn sign_out(
|
||||
self: &Arc<Self>,
|
||||
connection_id: zed_rpc::ConnectionId,
|
||||
connection_id: zrpc::ConnectionId,
|
||||
state: &AppState,
|
||||
) -> tide::Result<()>;
|
||||
}
|
||||
@ -133,7 +133,7 @@ pub trait PeerExt {
|
||||
impl PeerExt for Peer {
|
||||
async fn sign_out(
|
||||
self: &Arc<Self>,
|
||||
connection_id: zed_rpc::ConnectionId,
|
||||
connection_id: zrpc::ConnectionId,
|
||||
state: &AppState,
|
||||
) -> tide::Result<()> {
|
||||
self.disconnect(connection_id).await;
|
||||
|
@ -26,7 +26,7 @@ use std::sync::Arc;
|
||||
use surf::http::cookies::SameSite;
|
||||
use tide::{log, sessions::SessionMiddleware};
|
||||
use tide_compress::CompressMiddleware;
|
||||
use zed_rpc::Peer;
|
||||
use zrpc::Peer;
|
||||
|
||||
type Request = tide::Request<Arc<AppState>>;
|
||||
type DbPool = PgPool;
|
||||
|
@ -21,7 +21,7 @@ use tide::{
|
||||
http::headers::{HeaderName, CONNECTION, UPGRADE},
|
||||
Request, Response,
|
||||
};
|
||||
use zed_rpc::{
|
||||
use zrpc::{
|
||||
auth::random_token,
|
||||
proto::{self, EnvelopedMessage},
|
||||
ConnectionId, Peer, Router, TypedEnvelope,
|
||||
|
@ -21,7 +21,7 @@ use zed::{
|
||||
test::{temp_tree, Channel},
|
||||
worktree::{FakeFs, Fs, RealFs, Worktree},
|
||||
};
|
||||
use zed_rpc::{ForegroundRouter, Peer, Router};
|
||||
use zrpc::{ForegroundRouter, Peer, Router};
|
||||
|
||||
#[gpui::test]
|
||||
async fn test_share_worktree(mut cx_a: TestAppContext, mut cx_b: TestAppContext) {
|
||||
|
@ -14,7 +14,7 @@ name = "Zed"
|
||||
path = "src/main.rs"
|
||||
|
||||
[features]
|
||||
test-support = ["tempdir", "serde_json", "zed-rpc/test-support"]
|
||||
test-support = ["tempdir", "serde_json", "zrpc/test-support"]
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.38"
|
||||
@ -42,7 +42,7 @@ rust-embed = "5.9.0"
|
||||
seahash = "4.1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = { version = "1.0.64", features = [
|
||||
"preserve_order"
|
||||
"preserve_order",
|
||||
], optional = true }
|
||||
similar = "1.3"
|
||||
simplelog = "0.9"
|
||||
@ -55,7 +55,7 @@ toml = "0.5"
|
||||
tree-sitter = "0.19.5"
|
||||
tree-sitter-rust = "0.19.0"
|
||||
url = "2.2"
|
||||
zed-rpc = { path = "../zed-rpc" }
|
||||
zrpc = { path = "../zrpc" }
|
||||
|
||||
[dev-dependencies]
|
||||
cargo-bundle = "0.5.0"
|
||||
|
@ -11,7 +11,7 @@ use seahash::SeaHasher;
|
||||
pub use selection::*;
|
||||
use similar::{ChangeTag, TextDiff};
|
||||
use tree_sitter::{InputEdit, Parser, QueryCursor};
|
||||
use zed_rpc::proto;
|
||||
use zrpc::proto;
|
||||
|
||||
use crate::{
|
||||
language::{Language, Tree},
|
||||
|
@ -1,4 +1,4 @@
|
||||
use zed_rpc::ForegroundRouter;
|
||||
use zrpc::ForegroundRouter;
|
||||
|
||||
pub mod assets;
|
||||
pub mod editor;
|
||||
|
@ -11,7 +11,7 @@ use zed::{
|
||||
worktree::{self, RealFs},
|
||||
AppState,
|
||||
};
|
||||
use zed_rpc::ForegroundRouter;
|
||||
use zrpc::ForegroundRouter;
|
||||
|
||||
fn main() {
|
||||
init_logger();
|
||||
|
@ -9,8 +9,8 @@ use std::collections::HashMap;
|
||||
use std::time::Duration;
|
||||
use std::{convert::TryFrom, future::Future, sync::Arc};
|
||||
use surf::Url;
|
||||
pub use zed_rpc::{proto, ConnectionId, PeerId, TypedEnvelope};
|
||||
use zed_rpc::{
|
||||
pub use zrpc::{proto, ConnectionId, PeerId, TypedEnvelope};
|
||||
use zrpc::{
|
||||
proto::{EnvelopedMessage, RequestMessage},
|
||||
ForegroundRouter, Peer, Receipt,
|
||||
};
|
||||
@ -158,7 +158,7 @@ impl Client {
|
||||
// zed server to encrypt the user's access token, so that it can'be intercepted by
|
||||
// any other app running on the user's device.
|
||||
let (public_key, private_key) =
|
||||
zed_rpc::auth::keypair().expect("failed to generate keypair for auth");
|
||||
zrpc::auth::keypair().expect("failed to generate keypair for auth");
|
||||
let public_key_string =
|
||||
String::try_from(public_key).expect("failed to serialize public key for auth");
|
||||
|
||||
|
@ -7,10 +7,10 @@ use std::{
|
||||
sync::Arc,
|
||||
};
|
||||
use tempdir::TempDir;
|
||||
use zed_rpc::ForegroundRouter;
|
||||
use zrpc::ForegroundRouter;
|
||||
|
||||
#[cfg(feature = "test-support")]
|
||||
pub use zed_rpc::test::Channel;
|
||||
pub use zrpc::test::Channel;
|
||||
|
||||
#[cfg(test)]
|
||||
#[ctor::ctor]
|
||||
|
@ -61,8 +61,8 @@ impl<'a> AddAssign<&'a Local> for Local {
|
||||
#[derive(Clone, Default, Hash, Eq, PartialEq)]
|
||||
pub struct Global(SmallVec<[Local; 3]>);
|
||||
|
||||
impl From<Vec<zed_rpc::proto::VectorClockEntry>> for Global {
|
||||
fn from(message: Vec<zed_rpc::proto::VectorClockEntry>) -> Self {
|
||||
impl From<Vec<zrpc::proto::VectorClockEntry>> for Global {
|
||||
fn from(message: Vec<zrpc::proto::VectorClockEntry>) -> Self {
|
||||
let mut version = Self::new();
|
||||
for entry in message {
|
||||
version.observe(Local {
|
||||
@ -74,11 +74,11 @@ impl From<Vec<zed_rpc::proto::VectorClockEntry>> for Global {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a Global> for Vec<zed_rpc::proto::VectorClockEntry> {
|
||||
impl<'a> From<&'a Global> for Vec<zrpc::proto::VectorClockEntry> {
|
||||
fn from(version: &'a Global) -> Self {
|
||||
version
|
||||
.iter()
|
||||
.map(|entry| zed_rpc::proto::VectorClockEntry {
|
||||
.map(|entry| zrpc::proto::VectorClockEntry {
|
||||
replica_id: entry.replica_id as u32,
|
||||
timestamp: entry.value,
|
||||
})
|
||||
|
@ -49,7 +49,7 @@ use std::{
|
||||
},
|
||||
time::{Duration, SystemTime},
|
||||
};
|
||||
use zed_rpc::{ForegroundRouter, PeerId, TypedEnvelope};
|
||||
use zrpc::{ForegroundRouter, PeerId, TypedEnvelope};
|
||||
|
||||
lazy_static! {
|
||||
static ref GITIGNORE: &'static OsStr = OsStr::new(".gitignore");
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
description = "Shared logic for communication between the Zed app and the zed.dev server"
|
||||
edition = "2018"
|
||||
name = "zed-rpc"
|
||||
name = "zrpc"
|
||||
version = "0.1.0"
|
||||
|
||||
[features]
|
Loading…
Reference in New Issue
Block a user