diff --git a/server/src/tests.rs b/server/src/tests.rs index 041a5adcea..0f35b5161b 100644 --- a/server/src/tests.rs +++ b/server/src/tests.rs @@ -15,11 +15,12 @@ use sqlx::{ use std::{path::Path, sync::Arc}; use zed::{ editor::Editor, + fs::{FakeFs, Fs as _}, language::LanguageRegistry, rpc::Client, settings, test::Channel, - worktree::{FakeFs, Fs as _, Worktree}, + worktree::Worktree, }; use zrpc::{ForegroundRouter, Peer, Router}; diff --git a/zed/src/editor/buffer.rs b/zed/src/editor/buffer.rs index 6c1a0af436..c0ce0af2d7 100644 --- a/zed/src/editor/buffer.rs +++ b/zed/src/editor/buffer.rs @@ -2732,9 +2732,10 @@ impl ToPoint for usize { mod tests { use super::*; use crate::{ + fs::RealFs, test::{build_app_state, temp_tree}, util::RandomCharIter, - worktree::{RealFs, Worktree, WorktreeHandle}, + worktree::{Worktree, WorktreeHandle as _}, }; use gpui::ModelHandle; use rand::prelude::*; diff --git a/zed/src/file_finder.rs b/zed/src/file_finder.rs index 02ea62eaf6..2f5ad01101 100644 --- a/zed/src/file_finder.rs +++ b/zed/src/file_finder.rs @@ -457,9 +457,9 @@ mod tests { use super::*; use crate::{ editor, + fs::FakeFs, test::{build_app_state, temp_tree}, workspace::Workspace, - worktree::FakeFs, }; use serde_json::json; use std::fs; diff --git a/zed/src/worktree/fs.rs b/zed/src/fs.rs similarity index 99% rename from zed/src/worktree/fs.rs rename to zed/src/fs.rs index 5dc44ffb49..034e06d7c9 100644 --- a/zed/src/worktree/fs.rs +++ b/zed/src/fs.rs @@ -1,4 +1,4 @@ -use super::Rope; +use super::editor::Rope; use anyhow::{anyhow, Result}; use fsevent::EventStream; use futures::{Stream, StreamExt}; diff --git a/zed/src/lib.rs b/zed/src/lib.rs index d550c0ee49..efa0dd8288 100644 --- a/zed/src/lib.rs +++ b/zed/src/lib.rs @@ -3,6 +3,7 @@ use zrpc::ForegroundRouter; pub mod assets; pub mod editor; pub mod file_finder; +pub mod fs; pub mod language; pub mod menus; mod operation_queue; @@ -21,7 +22,7 @@ pub struct AppState { pub languages: std::sync::Arc, pub rpc_router: std::sync::Arc, pub rpc: rpc::Client, - pub fs: std::sync::Arc, + pub fs: std::sync::Arc, } pub fn init(cx: &mut gpui::MutableAppContext) { diff --git a/zed/src/main.rs b/zed/src/main.rs index 4630f215cb..d69818a541 100644 --- a/zed/src/main.rs +++ b/zed/src/main.rs @@ -6,9 +6,11 @@ use log::LevelFilter; use simplelog::SimpleLogger; use std::{fs, path::PathBuf, sync::Arc}; use zed::{ - self, assets, editor, file_finder, language, menus, rpc, settings, + self, assets, editor, file_finder, + fs::RealFs, + language, menus, rpc, settings, workspace::{self, OpenParams}, - worktree::{self, RealFs}, + worktree::{self}, AppState, }; use zrpc::ForegroundRouter; diff --git a/zed/src/test.rs b/zed/src/test.rs index c08f65937c..adc75100a0 100644 --- a/zed/src/test.rs +++ b/zed/src/test.rs @@ -1,6 +1,4 @@ -use crate::{ - language::LanguageRegistry, rpc, settings, time::ReplicaId, worktree::RealFs, AppState, -}; +use crate::{fs::RealFs, language::LanguageRegistry, rpc, settings, time::ReplicaId, AppState}; use gpui::AppContext; use std::{ path::{Path, PathBuf}, diff --git a/zed/src/workspace.rs b/zed/src/workspace.rs index 28aea860dc..4086eddd82 100644 --- a/zed/src/workspace.rs +++ b/zed/src/workspace.rs @@ -3,10 +3,11 @@ pub mod pane_group; use crate::{ editor::{Buffer, Editor}, + fs::Fs, language::LanguageRegistry, rpc, settings::Settings, - worktree::{File, Fs, Worktree}, + worktree::{File, Worktree}, AppState, }; use anyhow::{anyhow, Result}; @@ -921,8 +922,9 @@ mod tests { use super::*; use crate::{ editor::Editor, + fs::FakeFs, test::{build_app_state, temp_tree}, - worktree::{FakeFs, WorktreeHandle}, + worktree::WorktreeHandle, }; use serde_json::json; use std::{collections::HashSet, fs}; diff --git a/zed/src/worktree.rs b/zed/src/worktree.rs index 755bc56720..ada7af0c18 100644 --- a/zed/src/worktree.rs +++ b/zed/src/worktree.rs @@ -1,11 +1,11 @@ mod char_bag; -mod fs; mod fuzzy; mod ignore; use self::{char_bag::CharBag, ignore::IgnoreStack}; use crate::{ editor::{self, Buffer, History, Operation, Rope}, + fs::{self, Fs}, language::LanguageRegistry, rpc::{self, proto}, sum_tree::{self, Cursor, Edit, SumTree}, @@ -14,7 +14,6 @@ use crate::{ }; use ::ignore::gitignore::Gitignore; use anyhow::{anyhow, Result}; -pub use fs::*; use futures::{Stream, StreamExt}; pub use fuzzy::{match_paths, PathMatch}; use gpui::{ @@ -2571,6 +2570,7 @@ mod tests { use super::*; use crate::test::*; use anyhow::Result; + use fs::RealFs; use rand::prelude::*; use serde_json::json; use std::time::UNIX_EPOCH;