From af338cc505cd1aa69b6e60ac7091ca23188cf434 Mon Sep 17 00:00:00 2001 From: Lionel Cheng <60159831+lionelchg@users.noreply.github.com> Date: Wed, 3 Sep 2025 19:03:57 +0200 Subject: [PATCH] Improve @ file search: include specific hidden dirs such as .github, .gitlab (#2981) # Improve @ file search: include specific hidden dirs This should close #2980 ## What - Extend `@` fuzzy file search to include select top-level hidden directories: `.github`, `.gitlab`, `.circleci`, `.devcontainer`, `.azuredevops`, `.vscode`, `.cursor`. - Keep all other hidden directories excluded to avoid noise and heavy traversals. ## Why - Common project config lives under these dot-dirs (CI, editor, devcontainer); users expect `@.github/...` and similar paths to resolve. - Prior behavior hid all dot-dirs, making these files undiscoverable. ## How - In `codex-file-search` walker: - Enable hidden entries via `WalkBuilder.hidden(false)`. - Add `filter_entry` to only allow those specific root dot-directories; other hidden paths remain filtered out. - Preserve `.gitignore` semantics and existing exclude handling. ## Local checks - Ran formatting: `just fmt` - Ran lint (scoped): `just fix -p codex-file-search` - Ran tests: - `cargo test -p codex-file-search` - `cargo test -p codex-tui` ## Readiness - Branch is up-to-date locally; tests pass; lint/format applied. - No merge conflicts expected. - Marking Ready for review. --------- Signed-off-by: lionelchg --- codex-rs/file-search/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/codex-rs/file-search/src/lib.rs b/codex-rs/file-search/src/lib.rs index bfcfe922..3238c99f 100644 --- a/codex-rs/file-search/src/lib.rs +++ b/codex-rs/file-search/src/lib.rs @@ -151,7 +151,13 @@ pub fn run( // Use the same tree-walker library that ripgrep uses. We use it directly so // that we can leverage the parallelism it provides. let mut walk_builder = WalkBuilder::new(search_directory); - walk_builder.threads(num_walk_builder_threads); + walk_builder + .threads(num_walk_builder_threads) + // Allow hidden entries. + .hidden(false) + // Don't require git to be present to apply to apply git-related ignore rules. + .require_git(false); + if !exclude.is_empty() { let mut override_builder = OverrideBuilder::new(search_directory); for exclude in exclude {