Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Remove wiring for `assistant2` (#11940)

Marshall Bowersb9ecca75240e
diff --git a/.zed/tasks.json b/.zed/tasks.json
index c95cf5ffb18..80465969e2b 100644
--- a/.zed/tasks.json
+++ b/.zed/tasks.json
@@ -3,10 +3,5 @@
"label": "clippy",
"command": "cargo",
"args": ["xtask", "clippy"]
- },
- {
- "label": "assistant2",
- "command": "cargo",
- "args": ["run", "-p", "assistant2", "--example", "assistant_example"]
}
]
diff --git a/Cargo.lock b/Cargo.lock
index 404a428598b..71675fbee8e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -9734,7 +9734,6 @@ name = "storybook"
version = "0.1.0"
dependencies = [
"anyhow",
- "assistant2",
"clap 4.4.4",
"collab_ui",
"ctrlc",
@@ -12994,7 +12993,6 @@ dependencies = [
"anyhow",
"assets",
"assistant",
- "assistant2",
"audio",
"auto_update",
"backtrace",
diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.json
index 0d03767d8f5..d99f78ffa68 100644
--- a/assets/keymaps/default-macos.json
+++ b/assets/keymaps/default-macos.json
@@ -207,14 +207,6 @@
"ctrl-shift-enter": "editor::NewlineBelow"
}
},
- {
- "context": "AssistantChat > Editor", // Used in the assistant2 crate
- "bindings": {
- "enter": ["assistant2::Submit", "Simple"],
- "cmd-enter": ["assistant2::Submit", "Codebase"],
- "escape": "assistant2::Cancel"
- }
- },
{
"context": "AssistantPanel", // Used in the assistant crate, which we're replacing
"bindings": {
diff --git a/crates/storybook/Cargo.toml b/crates/storybook/Cargo.toml
index 0d084ae8476..1d7a828dd74 100644
--- a/crates/storybook/Cargo.toml
+++ b/crates/storybook/Cargo.toml
@@ -14,7 +14,6 @@ path = "src/storybook.rs"
[dependencies]
anyhow.workspace = true
-assistant2 = { workspace = true, features = ["stories"] }
clap = { workspace = true, features = ["derive", "string"] }
collab_ui = { workspace = true, features = ["stories"] }
ctrlc = "3.4"
diff --git a/crates/storybook/src/story_selector.rs b/crates/storybook/src/story_selector.rs
index 9d2c0308477..c7013a11f8f 100644
--- a/crates/storybook/src/story_selector.rs
+++ b/crates/storybook/src/story_selector.rs
@@ -12,8 +12,6 @@ use ui::prelude::*;
#[derive(Debug, PartialEq, Eq, Clone, Copy, strum::Display, EnumString, EnumIter)]
#[strum(serialize_all = "snake_case")]
pub enum ComponentStory {
- AssistantChatMessage,
- AssistantChatNotice,
AutoHeightEditor,
Avatar,
Button,
@@ -46,10 +44,6 @@ pub enum ComponentStory {
impl ComponentStory {
pub fn story(&self, cx: &mut WindowContext) -> AnyView {
match self {
- Self::AssistantChatMessage => {
- cx.new_view(|_cx| assistant2::ui::ChatMessageStory).into()
- }
- Self::AssistantChatNotice => cx.new_view(|_cx| assistant2::ui::ChatNoticeStory).into(),
Self::AutoHeightEditor => AutoHeightEditorStory::new(cx).into(),
Self::Avatar => cx.new_view(|_| ui::AvatarStory).into(),
Self::Button => cx.new_view(|_| ui::ButtonStory).into(),
diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml
index da908082c0e..9384286eaf9 100644
--- a/crates/zed/Cargo.toml
+++ b/crates/zed/Cargo.toml
@@ -19,7 +19,6 @@ activity_indicator.workspace = true
anyhow.workspace = true
assets.workspace = true
assistant.workspace = true
-assistant2.workspace = true
audio.workspace = true
auto_update.workspace = true
backtrace = "0.3"
diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs
index 7444b9d8211..957f753da31 100644
--- a/crates/zed/src/main.rs
+++ b/crates/zed/src/main.rs
@@ -175,7 +175,6 @@ fn init_ui(app_state: Arc<AppState>, cx: &mut AppContext) -> Result<()> {
inline_completion_registry::init(app_state.client.telemetry().clone(), cx);
assistant::init(app_state.client.clone(), cx);
- assistant2::init(app_state.client.clone(), cx);
cx.observe_global::<SettingsStore>({
let languages = app_state.languages.clone();
diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs
index 5124ef0074d..4bf4679297b 100644
--- a/crates/zed/src/zed.rs
+++ b/crates/zed/src/zed.rs
@@ -225,30 +225,6 @@ pub fn initialize_workspace(app_state: Arc<AppState>, cx: &mut AppContext) {
})
.detach();
- let mut current_user = app_state.user_store.read(cx).watch_current_user();
-
- cx.spawn(|workspace_handle, mut cx| async move {
- while let Some(user) = current_user.next().await {
- if user.is_some() {
- // User known now, can check feature flags / staff
- // At this point, should have the user with staff status available
- let use_assistant2 = cx.update(|cx| assistant2::enabled(cx))?;
- if use_assistant2 {
- let panel =
- assistant2::AssistantPanel::load(workspace_handle.clone(), cx.clone())
- .await?;
- workspace_handle.update(&mut cx, |workspace, cx| {
- workspace.add_panel(panel, cx);
- })?;
- }
-
- break;
- }
- }
- anyhow::Ok(())
- })
- .detach();
-
workspace
.register_action(about)
.register_action(|_, _: &Minimize, cx| {