Added absolute path info to remote worktrees (updated protocol version)
This commit is contained in:
parent
1789dfb8b1
commit
5bb2edca8b
9 changed files with 35 additions and 16 deletions
|
@ -3038,7 +3038,7 @@ async fn test_references(cx_a: &mut TestAppContext, cx_b: &mut TestAppContext) {
|
|||
assert_eq!(references[1].buffer, references[0].buffer);
|
||||
assert_eq!(
|
||||
three_buffer.file().unwrap().full_path(cx),
|
||||
Path::new("/OUTSIDE_PROJECT/three.rs")
|
||||
Path::new("/root/dir-2/three.rs")
|
||||
);
|
||||
|
||||
assert_eq!(references[0].range.to_offset(two_buffer), 24..27);
|
||||
|
|
|
@ -42,6 +42,7 @@ use std::{
|
|||
marker::PhantomData,
|
||||
net::SocketAddr,
|
||||
ops::{Deref, DerefMut},
|
||||
os::unix::prelude::OsStrExt,
|
||||
rc::Rc,
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering::SeqCst},
|
||||
|
@ -941,6 +942,7 @@ impl Server {
|
|||
id: *id,
|
||||
root_name: worktree.root_name.clone(),
|
||||
visible: worktree.visible,
|
||||
abs_path: worktree.abs_path.as_os_str().as_bytes().to_vec(),
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
|
@ -989,6 +991,7 @@ impl Server {
|
|||
let message = proto::UpdateWorktree {
|
||||
project_id: project_id.to_proto(),
|
||||
worktree_id: *worktree_id,
|
||||
abs_path: worktree.abs_path.as_os_str().as_bytes().to_vec(),
|
||||
root_name: worktree.root_name.clone(),
|
||||
updated_entries: worktree.entries.values().cloned().collect(),
|
||||
removed_entries: Default::default(),
|
||||
|
|
|
@ -66,6 +66,7 @@ pub struct Collaborator {
|
|||
|
||||
#[derive(Default, Serialize)]
|
||||
pub struct Worktree {
|
||||
pub abs_path: PathBuf,
|
||||
pub root_name: String,
|
||||
pub visible: bool,
|
||||
#[serde(skip)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue