Skip to content

Commit

Permalink
Update action filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdeviant committed Dec 17, 2024
1 parent 0154b6c commit 2e04a50
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions crates/assistant2/src/assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ mod thread_history;
mod thread_store;
mod ui;

use std::any::TypeId;
use std::sync::Arc;

use client::Client;
Expand Down Expand Up @@ -79,10 +78,6 @@ pub fn init(fs: Arc<dyn Fs>, client: Arc<Client>, stdout_is_a_pty: bool, cx: &mu
}

fn feature_gate_assistant2_actions(cx: &mut AppContext) {
const ASSISTANT1_NAMESPACE: &str = "assistant";

let inline_assist_actions = [TypeId::of::<zed_actions::InlineAssist>()];

CommandPaletteFilter::update_global(cx, |filter, _cx| {
filter.hide_namespace(NAMESPACE);
});
Expand All @@ -91,17 +86,10 @@ fn feature_gate_assistant2_actions(cx: &mut AppContext) {
if is_enabled {
CommandPaletteFilter::update_global(cx, |filter, _cx| {
filter.show_namespace(NAMESPACE);
filter.hide_namespace(ASSISTANT1_NAMESPACE);

// We're hiding all of the `assistant: ` actions, but we want to
// keep the inline assist action around so we can use the same
// one in Assistant2.
filter.show_action_types(inline_assist_actions.iter());
});
} else {
CommandPaletteFilter::update_global(cx, |filter, _cx| {
filter.hide_namespace(NAMESPACE);
filter.show_namespace(ASSISTANT1_NAMESPACE);
});
}
})
Expand Down

0 comments on commit 2e04a50

Please sign in to comment.