Port new workspace logic to gpui2, uncomment most of the workspace2 tests

This commit is contained in:
Kirill Bulatov 2023-11-17 22:54:19 +02:00
parent 616bda85e9
commit d352a63d9d
9 changed files with 2684 additions and 2267 deletions

View file

@ -5640,8 +5640,16 @@ impl Project {
.iter()
.filter_map(|(_, b)| {
let buffer = b.upgrade()?;
let snapshot = buffer.update(cx, |buffer, _| buffer.snapshot());
if let Some(path) = snapshot.file().map(|file| file.path()) {
let (is_ignored, snapshot) = buffer.update(cx, |buffer, cx| {
let is_ignored = buffer
.project_path(cx)
.and_then(|path| self.entry_for_path(&path, cx))
.map_or(false, |entry| entry.is_ignored);
(is_ignored, buffer.snapshot())
});
if is_ignored && !query.include_ignored() {
return None;
} else if let Some(path) = snapshot.file().map(|file| file.path()) {
Some((path.clone(), (buffer, snapshot)))
} else {
unnamed_files.push(buffer);