Remove remaining code associated with .zed.toml files
This commit is contained in:
parent
d7cba73ead
commit
054d697fb7
3 changed files with 2 additions and 29 deletions
|
@ -5880,13 +5880,7 @@ mod tests {
|
||||||
let host_language_registry = Arc::new(LanguageRegistry::test());
|
let host_language_registry = Arc::new(LanguageRegistry::test());
|
||||||
|
|
||||||
let fs = FakeFs::new(cx.background());
|
let fs = FakeFs::new(cx.background());
|
||||||
fs.insert_tree(
|
fs.insert_tree("/_collab", json!({"init": ""})).await;
|
||||||
"/_collab",
|
|
||||||
json!({
|
|
||||||
".zed.toml": r#"collaborators = ["guest-1", "guest-2", "guest-3", "guest-4"]"#
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
let mut server = TestServer::start(cx.foreground(), cx.background()).await;
|
let mut server = TestServer::start(cx.foreground(), cx.background()).await;
|
||||||
let db = server.app_state.db.clone();
|
let db = server.app_state.db.clone();
|
||||||
|
|
|
@ -32,7 +32,6 @@ use postage::{
|
||||||
prelude::{Sink as _, Stream as _},
|
prelude::{Sink as _, Stream as _},
|
||||||
watch,
|
watch,
|
||||||
};
|
};
|
||||||
use serde::Deserialize;
|
|
||||||
use smol::channel::{self, Sender};
|
use smol::channel::{self, Sender};
|
||||||
use std::{
|
use std::{
|
||||||
any::Any,
|
any::Any,
|
||||||
|
@ -64,7 +63,6 @@ pub enum Worktree {
|
||||||
|
|
||||||
pub struct LocalWorktree {
|
pub struct LocalWorktree {
|
||||||
snapshot: LocalSnapshot,
|
snapshot: LocalSnapshot,
|
||||||
config: WorktreeConfig,
|
|
||||||
background_snapshot: Arc<Mutex<LocalSnapshot>>,
|
background_snapshot: Arc<Mutex<LocalSnapshot>>,
|
||||||
last_scan_state_rx: watch::Receiver<ScanState>,
|
last_scan_state_rx: watch::Receiver<ScanState>,
|
||||||
_background_scanner_task: Option<Task<()>>,
|
_background_scanner_task: Option<Task<()>>,
|
||||||
|
@ -143,11 +141,6 @@ struct ShareState {
|
||||||
_maintain_remote_snapshot: Option<Task<Option<()>>>,
|
_maintain_remote_snapshot: Option<Task<Option<()>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Deserialize)]
|
|
||||||
struct WorktreeConfig {
|
|
||||||
collaborators: Vec<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub enum Event {
|
pub enum Event {
|
||||||
UpdatedEntries,
|
UpdatedEntries,
|
||||||
}
|
}
|
||||||
|
@ -460,13 +453,6 @@ impl LocalWorktree {
|
||||||
.await
|
.await
|
||||||
.context("failed to stat worktree path")?;
|
.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 (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 (mut last_scan_state_tx, last_scan_state_rx) = watch::channel_with(ScanState::Scanning);
|
||||||
let tree = cx.add_model(move |cx: &mut ModelContext<Worktree>| {
|
let tree = cx.add_model(move |cx: &mut ModelContext<Worktree>| {
|
||||||
|
@ -496,7 +482,6 @@ impl LocalWorktree {
|
||||||
|
|
||||||
let tree = Self {
|
let tree = Self {
|
||||||
snapshot: snapshot.clone(),
|
snapshot: snapshot.clone(),
|
||||||
config,
|
|
||||||
background_snapshot: Arc::new(Mutex::new(snapshot)),
|
background_snapshot: Arc::new(Mutex::new(snapshot)),
|
||||||
last_scan_state_rx,
|
last_scan_state_rx,
|
||||||
_background_scanner_task: None,
|
_background_scanner_task: None,
|
||||||
|
@ -544,10 +529,6 @@ impl LocalWorktree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn authorized_logins(&self) -> Vec<String> {
|
|
||||||
self.config.collaborators.clone()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn load_buffer(
|
pub(crate) fn load_buffer(
|
||||||
&mut self,
|
&mut self,
|
||||||
path: &Path,
|
path: &Path,
|
||||||
|
@ -879,7 +860,6 @@ impl LocalWorktree {
|
||||||
project_id,
|
project_id,
|
||||||
worktree_id: self.id().to_proto(),
|
worktree_id: self.id().to_proto(),
|
||||||
root_name: self.root_name().to_string(),
|
root_name: self.root_name().to_string(),
|
||||||
authorized_logins: self.authorized_logins(),
|
|
||||||
visible: self.visible,
|
visible: self.visible,
|
||||||
};
|
};
|
||||||
let request = client.request(register_message);
|
let request = client.request(register_message);
|
||||||
|
|
|
@ -151,8 +151,7 @@ message RegisterWorktree {
|
||||||
uint64 project_id = 1;
|
uint64 project_id = 1;
|
||||||
uint64 worktree_id = 2;
|
uint64 worktree_id = 2;
|
||||||
string root_name = 3;
|
string root_name = 3;
|
||||||
repeated string authorized_logins = 4;
|
bool visible = 4;
|
||||||
bool visible = 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message UnregisterWorktree {
|
message UnregisterWorktree {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue