diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index fdee1d2db7..641d89fa29 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -2205,8 +2205,11 @@ impl Project { snapshot.anchor_before(range.start) ..snapshot.anchor_after(range.end) }) - .collect(); - worker_matched_buffers.insert(buffer.clone(), buffer_matches); + .collect::>(); + if !buffer_matches.is_empty() { + worker_matched_buffers + .insert(buffer.clone(), buffer_matches); + } } }); }