From 8061bacee3b344bdd76a25a5a78506a552ade952 Mon Sep 17 00:00:00 2001 From: Adam Sherwood Date: Wed, 21 May 2025 12:03:39 +0200 Subject: [PATCH] Add excluded_files to pane::DeploySearch (#30699) In accordance with #30327, I saw no reason for included files to get special treatment, and I actually get use out of prefilling excluded files because I like not to search symlinked files which, in my workflow, use a naming convention. This is simply implementing the same exact changes, but for excluded. It was tested with `"space /": ["pane::DeploySearch", { "excluded_files": "**/_*.tf" }]` and works just fine. Release Notes: - Added `excluded_files` to `pane::DeploySearch`. --- crates/search/src/project_search.rs | 6 ++++++ crates/workspace/src/pane.rs | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs index 62e382c3cb15819244b12afdbc5e4354b085060b..52c9e189cfb7cb03b3c76ab34feadfd35bfe560c 100644 --- a/crates/search/src/project_search.rs +++ b/crates/search/src/project_search.rs @@ -1031,6 +1031,12 @@ impl ProjectSearchView { .update(cx, |editor, cx| editor.set_text(included_files, window, cx)); search.filters_enabled = true; } + if let Some(excluded_files) = action.excluded_files.as_deref() { + search + .excluded_files_editor + .update(cx, |editor, cx| editor.set_text(excluded_files, window, cx)); + search.filters_enabled = true; + } search.focus_query_editor(window, cx) }); } diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs index f2167c69770a38320f0a0a2a1ab3469fd6a24411..b4e293a5d7462665196c374380b838a12ab69c61 100644 --- a/crates/workspace/src/pane.rs +++ b/crates/workspace/src/pane.rs @@ -156,6 +156,8 @@ pub struct DeploySearch { pub replace_enabled: bool, #[serde(default)] pub included_files: Option, + #[serde(default)] + pub excluded_files: Option, } impl_actions!( @@ -203,6 +205,7 @@ impl DeploySearch { Self { replace_enabled: false, included_files: None, + excluded_files: None, } } } @@ -3114,6 +3117,7 @@ fn default_render_tab_bar_buttons( DeploySearch { replace_enabled: false, included_files: None, + excluded_files: None, } .boxed_clone(), )