diff --git a/zed-rpc/proto/zed.proto b/zed-rpc/proto/zed.proto index fb71c63c51..c64a5abd05 100644 --- a/zed-rpc/proto/zed.proto +++ b/zed-rpc/proto/zed.proto @@ -45,7 +45,7 @@ message OpenWorktreeResponse { message OpenBuffer { uint64 worktree_id = 1; - bytes path = 2; + string path = 2; } message OpenBufferResponse { @@ -53,13 +53,13 @@ message OpenBufferResponse { } message Worktree { - repeated bytes paths = 1; + repeated string paths = 1; } message Buffer { uint64 id = 1; - bytes path = 2; - bytes content = 3; + string path = 2; + string content = 3; repeated Operation history = 4; } diff --git a/zed-rpc/src/peer.rs b/zed-rpc/src/peer.rs index 51c5d00737..674ccb43cc 100644 --- a/zed-rpc/src/peer.rs +++ b/zed-rpc/src/peer.rs @@ -340,7 +340,7 @@ mod tests { }; let response1 = proto::OpenWorktreeResponse { worktree: Some(proto::Worktree { - paths: vec![b"path/one".to_vec()], + paths: vec!["path/one".to_string()], }), }; let request2 = proto::OpenWorktree { @@ -349,30 +349,30 @@ mod tests { }; let response2 = proto::OpenWorktreeResponse { worktree: Some(proto::Worktree { - paths: vec![b"path/two".to_vec(), b"path/three".to_vec()], + paths: vec!["path/two".to_string(), "path/three".to_string()], }), }; let request3 = proto::OpenBuffer { worktree_id: 102, - path: b"path/two".to_vec(), + path: "path/two".to_string(), }; let response3 = proto::OpenBufferResponse { buffer: Some(proto::Buffer { id: 1001, - path: b"path/two".to_vec(), - content: b"path/two content".to_vec(), + path: "path/two".to_string(), + content: "path/two content".to_string(), history: vec![], }), }; let request4 = proto::OpenBuffer { worktree_id: 101, - path: b"path/one".to_vec(), + path: "path/one".to_string(), }; let response4 = proto::OpenBufferResponse { buffer: Some(proto::Buffer { id: 1002, - path: b"path/one".to_vec(), - content: b"path/one content".to_vec(), + path: "path/one".to_string(), + content: "path/one content".to_string(), history: vec![], }), }; diff --git a/zed-rpc/src/proto.rs b/zed-rpc/src/proto.rs index a87fbabf0d..162e31df9a 100644 --- a/zed-rpc/src/proto.rs +++ b/zed-rpc/src/proto.rs @@ -131,7 +131,7 @@ mod tests { let message2 = ShareWorktree { worktree: Some(Worktree { - paths: vec![b"ok".to_vec()], + paths: vec!["ok".to_string()], }), } .into_envelope(5, None); diff --git a/zed/src/worktree.rs b/zed/src/worktree.rs index f01cc975cd..1d837a017a 100644 --- a/zed/src/worktree.rs +++ b/zed/src/worktree.rs @@ -239,7 +239,7 @@ impl Worktree { .spawn(async move { snapshot .paths() - .map(|path| path.as_os_str().as_bytes().to_vec()) + .map(|path| path.to_string_lossy().to_string()) .collect() }) .await;