Pass a new query parameter into the search

This commit is contained in:
Kirill Bulatov 2023-11-10 10:56:28 +02:00
parent 8837045abb
commit a5c615ceb4
16 changed files with 143 additions and 32 deletions

View file

@ -5618,7 +5618,16 @@ impl Project {
.collect::<Vec<_>>();
let background = cx.background_executor().clone();
let path_count: usize = snapshots.iter().map(|s| s.visible_file_count()).sum();
let path_count: usize = snapshots
.iter()
.map(|s| {
if query.include_ignored() {
s.file_count()
} else {
s.visible_file_count()
}
})
.sum();
if path_count == 0 {
let (_, rx) = smol::channel::bounded(1024);
return rx;
@ -5806,7 +5815,12 @@ impl Project {
let mut snapshot_start_ix = 0;
let mut abs_path = PathBuf::new();
for snapshot in snapshots {
let snapshot_end_ix = snapshot_start_ix + snapshot.visible_file_count();
let snapshot_end_ix = snapshot_start_ix
+ if query.include_ignored() {
snapshot.file_count()
} else {
snapshot.visible_file_count()
};
if worker_end_ix <= snapshot_start_ix {
break;
} else if worker_start_ix > snapshot_end_ix {
@ -5819,7 +5833,7 @@ impl Project {
cmp::min(worker_end_ix, snapshot_end_ix) - snapshot_start_ix;
for entry in snapshot
.files(false, start_in_snapshot)
.files(query.include_ignored(), start_in_snapshot)
.take(end_in_snapshot - start_in_snapshot)
{
if matching_paths_tx.is_closed() {