Refactor SearchSettings (#17550)

Related to #17179.

Simplify handling of search settings since there is no requirement to
watch for settings.json changes and update search panels while they are
opened.

Attn: @SomeoneToIgnore 

Per our discussion. Ran test on search crate. Ran `cargo fmt`.

Release Notes:

- N/A
This commit is contained in:
thataboy
2024-09-07 19:58:28 -04:00
committed by GitHub
parent 63188b6754
commit 894866da94
3 changed files with 6 additions and 32 deletions
-21
View File
@@ -171,27 +171,6 @@ pub struct SearchSettings {
pub regex: bool,
}
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)]
pub struct SearchSettingsContent {
pub whole_word: Option<bool>,
pub case_sensitive: Option<bool>,
pub include_ignored: Option<bool>,
pub regex: Option<bool>,
}
impl Settings for SearchSettings {
const KEY: Option<&'static str> = Some("search");
type FileContent = SearchSettingsContent;
fn load(
sources: SettingsSources<Self::FileContent>,
_: &mut gpui::AppContext,
) -> anyhow::Result<Self> {
sources.json_merge()
}
}
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema)]
pub struct EditorSettingsContent {
/// Whether the cursor blinks in the editor.