Skip to content

Commit

Permalink
Enable assistant on stable
Browse files Browse the repository at this point in the history
Co-Authored-By: Nathan Sobo <[email protected]>
  • Loading branch information
as-cii and nathansobo committed Jun 28, 2023
1 parent 0d0c71e commit 2cb4616
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
8 changes: 1 addition & 7 deletions crates/ai/src/assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use std::{
time::Duration,
};
use theme::AssistantStyle;
use util::{channel::ReleaseChannel, paths::CONVERSATIONS_DIR, post_inc, ResultExt, TryFutureExt};
use util::{paths::CONVERSATIONS_DIR, post_inc, ResultExt, TryFutureExt};
use workspace::{
dock::{DockPosition, Panel},
searchable::Direction,
Expand All @@ -62,12 +62,6 @@ actions!(
);

pub fn init(cx: &mut AppContext) {
if *util::channel::RELEASE_CHANNEL == ReleaseChannel::Stable {
cx.update_default_global::<collections::CommandPaletteFilter, _, _>(move |filter, _cx| {
filter.filtered_namespaces.insert("assistant");
});
}

settings::register::<AssistantSettings>(cx);
cx.add_action(
|this: &mut AssistantPanel,
Expand Down
18 changes: 6 additions & 12 deletions crates/zed/src/zed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,15 @@ pub fn initialize_workspace(

let project_panel = ProjectPanel::load(workspace_handle.clone(), cx.clone());
let terminal_panel = TerminalPanel::load(workspace_handle.clone(), cx.clone());
let assistant_panel = if *util::channel::RELEASE_CHANNEL == ReleaseChannel::Stable {
None
} else {
Some(AssistantPanel::load(workspace_handle.clone(), cx.clone()).await?)
};
let (project_panel, terminal_panel) = futures::try_join!(project_panel, terminal_panel)?;
let assistant_panel = AssistantPanel::load(workspace_handle.clone(), cx.clone());
let (project_panel, terminal_panel, assistant_panel) =
futures::try_join!(project_panel, terminal_panel, assistant_panel)?;
workspace_handle.update(&mut cx, |workspace, cx| {
let project_panel_position = project_panel.position(cx);
workspace.add_panel(project_panel, cx);
workspace.add_panel(terminal_panel, cx);
workspace.add_panel(assistant_panel, cx);

if !was_deserialized
&& workspace
.project()
Expand All @@ -383,13 +383,7 @@ pub fn initialize_workspace(
{
workspace.toggle_dock(project_panel_position, cx);
}

cx.focus_self();

workspace.add_panel(terminal_panel, cx);
if let Some(assistant_panel) = assistant_panel {
workspace.add_panel(assistant_panel, cx);
}
})?;
Ok(())
})
Expand Down

0 comments on commit 2cb4616

Please sign in to comment.