Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Delete /workflow (#19900)
Richard Feldman21137d2ba743
diff --git a/crates/assistant/src/assistant.rs b/crates/assistant/src/assistant.rsindex c96358ae998..c2857d06d43 100644--- a/crates/assistant/src/assistant.rs+++ b/crates/assistant/src/assistant.rs@@ -41,12 +41,10 @@ use prompts::PromptLoadingParams;use semantic_index::{CloudEmbeddingProvider, SemanticDb};use serde::{Deserialize, Serialize};use settings::{update_settings_file, Settings, SettingsStore};-use slash_command::workflow_command::WorkflowSlashCommand;use slash_command::{auto_command, cargo_workspace_command, context_server_command, default_command, delta_command,diagnostics_command, docs_command, fetch_command, file_command, now_command, project_command,prompt_command, search_command, symbols_command, tab_command, terminal_command,- workflow_command,};use std::path::PathBuf;use std::sync::Arc;@@ -445,22 +443,6 @@ fn register_slash_commands(prompt_builder: Option<Arc<PromptBuilder>>, cx: &mutslash_command_registry.register_command(fetch_command::FetchSlashCommand, false);if let Some(prompt_builder) = prompt_builder {- cx.observe_global::<SettingsStore>({- let slash_command_registry = slash_command_registry.clone();- let prompt_builder = prompt_builder.clone();- move |cx| {- if AssistantSettings::get_global(cx).are_live_diffs_enabled(cx) {- slash_command_registry.register_command(- workflow_command::WorkflowSlashCommand::new(prompt_builder.clone()),- true,- );- } else {- slash_command_registry.unregister_command_by_name(WorkflowSlashCommand::NAME);- }- }- })- .detach();-cx.observe_flag::<project_command::ProjectSlashCommandFeatureFlag, _>({let slash_command_registry = slash_command_registry.clone();move |is_enabled, _cx| {diff --git a/crates/assistant/src/slash_command.rs b/crates/assistant/src/slash_command.rsindex e430e35622a..ed20791d956 100644--- a/crates/assistant/src/slash_command.rs+++ b/crates/assistant/src/slash_command.rs@@ -34,7 +34,6 @@ pub mod search_command;pub mod symbols_command;pub mod tab_command;pub mod terminal_command;-pub mod workflow_command;pub(crate) struct SlashCommandCompletionProvider {cancel_flag: Mutex<Arc<AtomicBool>>,diff --git a/crates/assistant/src/slash_command/workflow_command.rs b/crates/assistant/src/slash_command/workflow_command.rsdeleted file mode 100644index ca6ccde92ee..00000000000--- a/crates/assistant/src/slash_command/workflow_command.rs+++ /dev/null@@ -1,82 +0,0 @@-use std::sync::atomic::AtomicBool;-use std::sync::Arc;--use anyhow::Result;-use assistant_slash_command::{- ArgumentCompletion, SlashCommand, SlashCommandOutput, SlashCommandOutputSection,- SlashCommandResult,-};-use gpui::{Task, WeakView};-use language::{BufferSnapshot, LspAdapterDelegate};-use ui::prelude::*;-use workspace::Workspace;--use crate::prompts::PromptBuilder;--pub(crate) struct WorkflowSlashCommand {- prompt_builder: Arc<PromptBuilder>,-}--impl WorkflowSlashCommand {- pub const NAME: &'static str = "workflow";-- pub fn new(prompt_builder: Arc<PromptBuilder>) -> Self {- Self { prompt_builder }- }-}--impl SlashCommand for WorkflowSlashCommand {- fn name(&self) -> String {- Self::NAME.into()- }-- fn description(&self) -> String {- "Insert prompt to opt into the edit workflow".into()- }-- fn menu_text(&self) -> String {- self.description()- }-- fn requires_argument(&self) -> bool {- false- }-- fn complete_argument(- self: Arc<Self>,- _arguments: &[String],- _cancel: Arc<AtomicBool>,- _workspace: Option<WeakView<Workspace>>,- _cx: &mut WindowContext,- ) -> Task<Result<Vec<ArgumentCompletion>>> {- Task::ready(Ok(Vec::new()))- }-- fn run(- self: Arc<Self>,- _arguments: &[String],- _context_slash_command_output_sections: &[SlashCommandOutputSection<language::Anchor>],- _context_buffer: BufferSnapshot,- _workspace: WeakView<Workspace>,- _delegate: Option<Arc<dyn LspAdapterDelegate>>,- cx: &mut WindowContext,- ) -> Task<SlashCommandResult> {- let prompt_builder = self.prompt_builder.clone();- cx.spawn(|_cx| async move {- let text = prompt_builder.generate_workflow_prompt()?;- let range = 0..text.len();-- Ok(SlashCommandOutput {- text,- sections: vec![SlashCommandOutputSection {- range,- icon: IconName::Route,- label: "Workflow".into(),- metadata: None,- }],- run_commands_in_text: false,- }- .to_event_stream())- })- }-}