## Fix incorrect directory path folding in slash command file collection **Description:** This PR fixes a bug in the `collect_files` function where the directory folding logic (used to compact chains like `.github/workflows`) failed to reset its state when traversing out of a folded branch. **The Issue:** The `folded_directory_names` accumulator was persisting across loop iterations. If the traversal moved from a folded directory (e.g., `.github/workflows`) to a sibling directory (e.g., `.zed`), the sibling would incorrectly inherit the prefix of the previously folded path, resulting in incorrect paths like `.github/.zed`. **The Fix:** * Introduced `folded_directory_path` to track the specific path currently being folded. * Added a check to reset `folded_directory_names` whenever the traversal encounters an entry that is not a child of the currently folded path. * Ensured state is cleared immediately after a folded directory is rendered. **Release Notes:** - Fixed an issue where using slash commands to collect files would sometimes display incorrect directory paths (e.g., showing `.github/.zed` instead of `.zed`) when adjacent directories were automatically folded. --------- Co-authored-by: Lukas Wirth <lukas@zed.dev>
48 lines
1.2 KiB
TOML
48 lines
1.2 KiB
TOML
[package]
|
|
name = "assistant_slash_commands"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
publish.workspace = true
|
|
license = "GPL-3.0-or-later"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
path = "src/assistant_slash_commands.rs"
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
assistant_slash_command.workspace = true
|
|
chrono.workspace = true
|
|
collections.workspace = true
|
|
context_server.workspace = true
|
|
editor.workspace = true
|
|
feature_flags.workspace = true
|
|
fs.workspace = true
|
|
futures.workspace = true
|
|
fuzzy.workspace = true
|
|
gpui.workspace = true
|
|
html_to_markdown.workspace = true
|
|
http_client.workspace = true
|
|
language.workspace = true
|
|
project.workspace = true
|
|
prompt_store.workspace = true
|
|
rope.workspace = true
|
|
serde.workspace = true
|
|
serde_json.workspace = true
|
|
smol.workspace = true
|
|
text.workspace = true
|
|
ui.workspace = true
|
|
util.workspace = true
|
|
workspace.workspace = true
|
|
worktree.workspace = true
|
|
|
|
[dev-dependencies]
|
|
fs = { workspace = true, features = ["test-support"] }
|
|
gpui = { workspace = true, features = ["test-support"] }
|
|
pretty_assertions.workspace = true
|
|
project = { workspace = true, features = ["test-support"] }
|
|
settings = { workspace = true, features = ["test-support"] }
|
|
zlog.workspace = true
|