Move the fs module out of worktree

This commit is contained in:
Max Brunsfeld 2021-07-13 15:37:30 -07:00
parent dcae4747b0
commit 7260442d42
9 changed files with 19 additions and 14 deletions

View file

@ -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};

View file

@ -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::*;

View file

@ -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;

View file

@ -1,4 +1,4 @@
use super::Rope;
use super::editor::Rope;
use anyhow::{anyhow, Result};
use fsevent::EventStream;
use futures::{Stream, StreamExt};

View file

@ -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<language::LanguageRegistry>,
pub rpc_router: std::sync::Arc<ForegroundRouter>,
pub rpc: rpc::Client,
pub fs: std::sync::Arc<dyn worktree::Fs>,
pub fs: std::sync::Arc<dyn fs::Fs>,
}
pub fn init(cx: &mut gpui::MutableAppContext) {

View file

@ -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;

View file

@ -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},

View file

@ -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};

View file

@ -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;