Change summary
crates/search2/src/mode.rs | 11 ++++-------
crates/search2/src/search_bar.rs | 4 ++--
2 files changed, 6 insertions(+), 9 deletions(-)
Detailed changes
@@ -1,6 +1,3 @@
-use gpui::Action;
-
-use crate::{ActivateRegexMode, ActivateSemanticMode, ActivateTextMode};
// TODO: Update the default search mode to get from config
#[derive(Copy, Clone, Debug, Default, PartialEq)]
pub enum SearchMode {
@@ -11,11 +8,11 @@ pub enum SearchMode {
}
impl SearchMode {
- pub(crate) fn activate_action(&self) -> Box<dyn Action> {
+ pub(crate) fn label(&self) -> &'static str {
match self {
- SearchMode::Text => Box::new(ActivateTextMode),
- SearchMode::Semantic => Box::new(ActivateSemanticMode),
- SearchMode::Regex => Box::new(ActivateRegexMode),
+ SearchMode::Text => "Text",
+ SearchMode::Semantic => "Semantic",
+ SearchMode::Regex => "Regex",
}
}
}
@@ -1,6 +1,6 @@
-use std::{borrow::Cow, sync::Arc};
+use std::sync::Arc;
-use gpui::{div, Action, Component, ViewContext};
+use gpui::{Component, ViewContext};
use ui::{Button, ButtonVariant, IconButton};
use crate::mode::SearchMode;