Move the fs module out of worktree
This commit is contained in:
parent
dcae4747b0
commit
7260442d42
9 changed files with 19 additions and 14 deletions
|
@ -15,11 +15,12 @@ use sqlx::{
|
||||||
use std::{path::Path, sync::Arc};
|
use std::{path::Path, sync::Arc};
|
||||||
use zed::{
|
use zed::{
|
||||||
editor::Editor,
|
editor::Editor,
|
||||||
|
fs::{FakeFs, Fs as _},
|
||||||
language::LanguageRegistry,
|
language::LanguageRegistry,
|
||||||
rpc::Client,
|
rpc::Client,
|
||||||
settings,
|
settings,
|
||||||
test::Channel,
|
test::Channel,
|
||||||
worktree::{FakeFs, Fs as _, Worktree},
|
worktree::Worktree,
|
||||||
};
|
};
|
||||||
use zrpc::{ForegroundRouter, Peer, Router};
|
use zrpc::{ForegroundRouter, Peer, Router};
|
||||||
|
|
||||||
|
|
|
@ -2732,9 +2732,10 @@ impl ToPoint for usize {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
fs::RealFs,
|
||||||
test::{build_app_state, temp_tree},
|
test::{build_app_state, temp_tree},
|
||||||
util::RandomCharIter,
|
util::RandomCharIter,
|
||||||
worktree::{RealFs, Worktree, WorktreeHandle},
|
worktree::{Worktree, WorktreeHandle as _},
|
||||||
};
|
};
|
||||||
use gpui::ModelHandle;
|
use gpui::ModelHandle;
|
||||||
use rand::prelude::*;
|
use rand::prelude::*;
|
||||||
|
|
|
@ -457,9 +457,9 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
editor,
|
editor,
|
||||||
|
fs::FakeFs,
|
||||||
test::{build_app_state, temp_tree},
|
test::{build_app_state, temp_tree},
|
||||||
workspace::Workspace,
|
workspace::Workspace,
|
||||||
worktree::FakeFs,
|
|
||||||
};
|
};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use super::Rope;
|
use super::editor::Rope;
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use fsevent::EventStream;
|
use fsevent::EventStream;
|
||||||
use futures::{Stream, StreamExt};
|
use futures::{Stream, StreamExt};
|
|
@ -3,6 +3,7 @@ use zrpc::ForegroundRouter;
|
||||||
pub mod assets;
|
pub mod assets;
|
||||||
pub mod editor;
|
pub mod editor;
|
||||||
pub mod file_finder;
|
pub mod file_finder;
|
||||||
|
pub mod fs;
|
||||||
pub mod language;
|
pub mod language;
|
||||||
pub mod menus;
|
pub mod menus;
|
||||||
mod operation_queue;
|
mod operation_queue;
|
||||||
|
@ -21,7 +22,7 @@ pub struct AppState {
|
||||||
pub languages: std::sync::Arc<language::LanguageRegistry>,
|
pub languages: std::sync::Arc<language::LanguageRegistry>,
|
||||||
pub rpc_router: std::sync::Arc<ForegroundRouter>,
|
pub rpc_router: std::sync::Arc<ForegroundRouter>,
|
||||||
pub rpc: rpc::Client,
|
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) {
|
pub fn init(cx: &mut gpui::MutableAppContext) {
|
||||||
|
|
|
@ -6,9 +6,11 @@ use log::LevelFilter;
|
||||||
use simplelog::SimpleLogger;
|
use simplelog::SimpleLogger;
|
||||||
use std::{fs, path::PathBuf, sync::Arc};
|
use std::{fs, path::PathBuf, sync::Arc};
|
||||||
use zed::{
|
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},
|
workspace::{self, OpenParams},
|
||||||
worktree::{self, RealFs},
|
worktree::{self},
|
||||||
AppState,
|
AppState,
|
||||||
};
|
};
|
||||||
use zrpc::ForegroundRouter;
|
use zrpc::ForegroundRouter;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
use crate::{
|
use crate::{fs::RealFs, language::LanguageRegistry, rpc, settings, time::ReplicaId, AppState};
|
||||||
language::LanguageRegistry, rpc, settings, time::ReplicaId, worktree::RealFs, AppState,
|
|
||||||
};
|
|
||||||
use gpui::AppContext;
|
use gpui::AppContext;
|
||||||
use std::{
|
use std::{
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
|
|
|
@ -3,10 +3,11 @@ pub mod pane_group;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
editor::{Buffer, Editor},
|
editor::{Buffer, Editor},
|
||||||
|
fs::Fs,
|
||||||
language::LanguageRegistry,
|
language::LanguageRegistry,
|
||||||
rpc,
|
rpc,
|
||||||
settings::Settings,
|
settings::Settings,
|
||||||
worktree::{File, Fs, Worktree},
|
worktree::{File, Worktree},
|
||||||
AppState,
|
AppState,
|
||||||
};
|
};
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
|
@ -921,8 +922,9 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
editor::Editor,
|
editor::Editor,
|
||||||
|
fs::FakeFs,
|
||||||
test::{build_app_state, temp_tree},
|
test::{build_app_state, temp_tree},
|
||||||
worktree::{FakeFs, WorktreeHandle},
|
worktree::WorktreeHandle,
|
||||||
};
|
};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use std::{collections::HashSet, fs};
|
use std::{collections::HashSet, fs};
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
mod char_bag;
|
mod char_bag;
|
||||||
mod fs;
|
|
||||||
mod fuzzy;
|
mod fuzzy;
|
||||||
mod ignore;
|
mod ignore;
|
||||||
|
|
||||||
use self::{char_bag::CharBag, ignore::IgnoreStack};
|
use self::{char_bag::CharBag, ignore::IgnoreStack};
|
||||||
use crate::{
|
use crate::{
|
||||||
editor::{self, Buffer, History, Operation, Rope},
|
editor::{self, Buffer, History, Operation, Rope},
|
||||||
|
fs::{self, Fs},
|
||||||
language::LanguageRegistry,
|
language::LanguageRegistry,
|
||||||
rpc::{self, proto},
|
rpc::{self, proto},
|
||||||
sum_tree::{self, Cursor, Edit, SumTree},
|
sum_tree::{self, Cursor, Edit, SumTree},
|
||||||
|
@ -14,7 +14,6 @@ use crate::{
|
||||||
};
|
};
|
||||||
use ::ignore::gitignore::Gitignore;
|
use ::ignore::gitignore::Gitignore;
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
pub use fs::*;
|
|
||||||
use futures::{Stream, StreamExt};
|
use futures::{Stream, StreamExt};
|
||||||
pub use fuzzy::{match_paths, PathMatch};
|
pub use fuzzy::{match_paths, PathMatch};
|
||||||
use gpui::{
|
use gpui::{
|
||||||
|
@ -2571,6 +2570,7 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::test::*;
|
use crate::test::*;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
|
use fs::RealFs;
|
||||||
use rand::prelude::*;
|
use rand::prelude::*;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use std::time::UNIX_EPOCH;
|
use std::time::UNIX_EPOCH;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue