mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-28 01:07:09 +00:00
WIP
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
parent
9899614f31
commit
5cbbf620ed
1 changed files with 12 additions and 4 deletions
|
@ -5,7 +5,7 @@ use crate::{
|
||||||
editor::{History, Snapshot as BufferSnapshot},
|
editor::{History, Snapshot as BufferSnapshot},
|
||||||
sum_tree::{self, Edit, SumTree},
|
sum_tree::{self, Edit, SumTree},
|
||||||
};
|
};
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Context, Result};
|
||||||
use fuzzy::PathEntry;
|
use fuzzy::PathEntry;
|
||||||
pub use fuzzy::{match_paths, PathMatch};
|
pub use fuzzy::{match_paths, PathMatch};
|
||||||
use gpui::{scoped_pool, AppContext, Entity, ModelContext, ModelHandle, Task};
|
use gpui::{scoped_pool, AppContext, Entity, ModelContext, ModelHandle, Task};
|
||||||
|
@ -781,11 +781,18 @@ impl BackgroundScanner {
|
||||||
let is_ignored = ignore.matched(&path, metadata.is_dir()).is_ignore();
|
let is_ignored = ignore.matched(&path, metadata.is_dir()).is_ignore();
|
||||||
|
|
||||||
let inode = metadata.ino();
|
let inode = metadata.ino();
|
||||||
let is_symlink = fs::symlink_metadata(&path)?.file_type().is_symlink();
|
let is_symlink = fs::symlink_metadata(&path)
|
||||||
|
.context("symlink_metadata")?
|
||||||
|
.file_type()
|
||||||
|
.is_symlink();
|
||||||
let parent = if path == root_path {
|
let parent = if path == root_path {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some(fs::metadata(path.parent().unwrap())?.ino())
|
Some(
|
||||||
|
fs::metadata(path.parent().unwrap())
|
||||||
|
.context("parent metadata")?
|
||||||
|
.ino(),
|
||||||
|
)
|
||||||
};
|
};
|
||||||
if metadata.file_type().is_dir() {
|
if metadata.file_type().is_dir() {
|
||||||
Ok(Some((
|
Ok(Some((
|
||||||
|
@ -819,10 +826,11 @@ impl BackgroundScanner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
dbg!(&err);
|
||||||
if err.kind() == io::ErrorKind::NotFound {
|
if err.kind() == io::ErrorKind::NotFound {
|
||||||
Ok(None)
|
Ok(None)
|
||||||
} else {
|
} else {
|
||||||
Err(anyhow::Error::new(err))
|
Err(anyhow::Error::new(err)).context("fs::metadata")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue