From 054d697fb74f21f9c8dc1b674b87e8f8a80678a2 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 9 May 2022 16:23:27 -0700 Subject: [PATCH] Remove remaining code associated with .zed.toml files --- crates/collab/src/rpc.rs | 8 +------- crates/project/src/worktree.rs | 20 -------------------- crates/rpc/proto/zed.proto | 3 +-- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/crates/collab/src/rpc.rs b/crates/collab/src/rpc.rs index 4978b2fca4..98342f1be3 100644 --- a/crates/collab/src/rpc.rs +++ b/crates/collab/src/rpc.rs @@ -5880,13 +5880,7 @@ mod tests { let host_language_registry = Arc::new(LanguageRegistry::test()); let fs = FakeFs::new(cx.background()); - fs.insert_tree( - "/_collab", - json!({ - ".zed.toml": r#"collaborators = ["guest-1", "guest-2", "guest-3", "guest-4"]"# - }), - ) - .await; + fs.insert_tree("/_collab", json!({"init": ""})).await; let mut server = TestServer::start(cx.foreground(), cx.background()).await; let db = server.app_state.db.clone(); diff --git a/crates/project/src/worktree.rs b/crates/project/src/worktree.rs index bab41bbe27..84fedbbde7 100644 --- a/crates/project/src/worktree.rs +++ b/crates/project/src/worktree.rs @@ -32,7 +32,6 @@ use postage::{ prelude::{Sink as _, Stream as _}, watch, }; -use serde::Deserialize; use smol::channel::{self, Sender}; use std::{ any::Any, @@ -64,7 +63,6 @@ pub enum Worktree { pub struct LocalWorktree { snapshot: LocalSnapshot, - config: WorktreeConfig, background_snapshot: Arc>, last_scan_state_rx: watch::Receiver, _background_scanner_task: Option>, @@ -143,11 +141,6 @@ struct ShareState { _maintain_remote_snapshot: Option>>, } -#[derive(Default, Deserialize)] -struct WorktreeConfig { - collaborators: Vec, -} - pub enum Event { UpdatedEntries, } @@ -460,13 +453,6 @@ impl LocalWorktree { .await .context("failed to stat worktree path")?; - let mut config = WorktreeConfig::default(); - if let Ok(zed_toml) = fs.load(&abs_path.join(".zed.toml")).await { - if let Ok(parsed) = toml::from_str(&zed_toml) { - config = parsed; - } - } - let (scan_states_tx, mut scan_states_rx) = mpsc::unbounded(); let (mut last_scan_state_tx, last_scan_state_rx) = watch::channel_with(ScanState::Scanning); let tree = cx.add_model(move |cx: &mut ModelContext| { @@ -496,7 +482,6 @@ impl LocalWorktree { let tree = Self { snapshot: snapshot.clone(), - config, background_snapshot: Arc::new(Mutex::new(snapshot)), last_scan_state_rx, _background_scanner_task: None, @@ -544,10 +529,6 @@ impl LocalWorktree { } } - pub fn authorized_logins(&self) -> Vec { - self.config.collaborators.clone() - } - pub(crate) fn load_buffer( &mut self, path: &Path, @@ -879,7 +860,6 @@ impl LocalWorktree { project_id, worktree_id: self.id().to_proto(), root_name: self.root_name().to_string(), - authorized_logins: self.authorized_logins(), visible: self.visible, }; let request = client.request(register_message); diff --git a/crates/rpc/proto/zed.proto b/crates/rpc/proto/zed.proto index 55bdba9751..8adba5fc80 100644 --- a/crates/rpc/proto/zed.proto +++ b/crates/rpc/proto/zed.proto @@ -151,8 +151,7 @@ message RegisterWorktree { uint64 project_id = 1; uint64 worktree_id = 2; string root_name = 3; - repeated string authorized_logins = 4; - bool visible = 5; + bool visible = 4; } message UnregisterWorktree {