Files
zed/crates/search/Cargo.toml
T
34c48d6579 Fix project search holding a reference to closed unsaved files (#61677)
# Objective

Fixes #28398

## Solution

This issue was occurring because `ProjectSearch` stored
`Entity<MultiBuffer>` with has reference counted pointers to underlying
buffers
The function `remove_deleted_buffers` is renamed to
`remove_stale_buffers` and it now also checks for buffers which do not
have a file associated with them and are closed. Then, it removes them
from `Entity<MultiBuffer>` stored in ProjectSearch. This function is
also called in again when workspace is upgraded.

## Testing

Bug being fixed was manually verified. 

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable


Release Notes:

- Fixed project search retaining results from closed untitled buffers.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-08-26 17:00:03 +00:00

66 lines
1.5 KiB
TOML

[package]
name = "search"
version = "0.1.0"
edition.workspace = true
publish.workspace = true
license = "GPL-3.0-or-later"
[features]
test-support = [
"editor/test-support",
"gpui/test-support",
"workspace/test-support",
]
[lints]
workspace = true
[lib]
path = "src/search.rs"
doctest = false
[dependencies]
anyhow.workspace = true
any_vec.workspace = true
bitflags.workspace = true
collections.workspace = true
db.workspace = true
editor.workspace = true
file_icons.workspace = true
fs.workspace = true
futures.workspace = true
gpui.workspace = true
language.workspace = true
log.workspace = true
menu.workspace = true
multi_buffer.workspace = true
picker.workspace = true
picker_preview.workspace = true
project.workspace = true
regex.workspace = true
serde_json.workspace = true
settings.workspace = true
smol.workspace = true
text.workspace = true
theme.workspace = true
theme_settings.workspace = true
ui.workspace = true
util.workspace = true
util_macros.workspace = true
workspace.workspace = true
zed_actions.workspace = true
itertools.workspace = true
ztracing.workspace = true
tracing.workspace = true
[dev-dependencies]
editor = { workspace = true, features = ["test-support"] }
gpui = { workspace = true, features = ["test-support"] }
language = { workspace = true, features = ["test-support"] }
lsp.workspace = true
pretty_assertions.workspace = true
proto.workspace = true
unindent.workspace = true
workspace = { workspace = true, features = ["test-support"] }