file_finder: Put collab channel inclusion behind a setting (#51505)

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Lukas Wirth 2026-03-13 17:52:50 +01:00 committed by GitHub
parent e29206b569
commit f04b4e089f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 1 deletions

View file

@ -1285,6 +1285,8 @@
// * "indexed": Use only the files Zed had indexed
// * "smart": Be smart and search for ignored when called from a gitignored worktree
"include_ignored": "smart",
// Whether to include text channels in file finder results.
"include_channels": false,
},
// Whether or not to remove any trailing whitespace from lines of a buffer
// before saving it.

View file

@ -844,7 +844,11 @@ impl FileFinderDelegate {
cx: &mut Context<FileFinder>,
) -> Self {
Self::subscribe_to_updates(&project, window, cx);
let channel_store = ChannelStore::try_global(cx);
let channel_store = if FileFinderSettings::get_global(cx).include_channels {
ChannelStore::try_global(cx)
} else {
None
};
Self {
file_finder,
workspace,

View file

@ -8,6 +8,7 @@ pub struct FileFinderSettings {
pub modal_max_width: FileFinderWidth,
pub skip_focus_for_active_in_search: bool,
pub include_ignored: Option<bool>,
pub include_channels: bool,
}
impl Settings for FileFinderSettings {
@ -23,6 +24,7 @@ impl Settings for FileFinderSettings {
settings::IncludeIgnoredContent::Indexed => Some(false),
settings::IncludeIgnoredContent::Smart => None,
},
include_channels: file_finder.include_channels.unwrap(),
}
}
}

View file

@ -721,6 +721,10 @@ pub struct FileFinderSettingsContent {
///
/// Default: Smart
pub include_ignored: Option<IncludeIgnoredContent>,
/// Whether to include text channels in file finder results.
///
/// Default: false
pub include_channels: Option<bool>,
}
#[derive(