From b5f816dde52432b48bc7ac8ab9cc15514317877a Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 24 Oct 2024 13:39:06 -0400 Subject: [PATCH] assistant: Add implementation for `/delta` argument completion (#19693) This PR fixes a panic that could occur when trying to complete arguments for the `/delta` slash command. We were using `unimplemented!()` instead of providing a default no-op implementation like we do for other slash commands that do not support completing arguments. Closes https://github.com/zed-industries/zed/issues/19686. Release Notes: - Fixed a panic that could occur when trying to complete arguments with the `/delta` command. --- crates/assistant/src/slash_command/delta_command.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/assistant/src/slash_command/delta_command.rs b/crates/assistant/src/slash_command/delta_command.rs index a37d33e2af..c9985d9f00 100644 --- a/crates/assistant/src/slash_command/delta_command.rs +++ b/crates/assistant/src/slash_command/delta_command.rs @@ -1,5 +1,5 @@ use crate::slash_command::file_command::{FileCommandMetadata, FileSlashCommand}; -use anyhow::Result; +use anyhow::{anyhow, Result}; use assistant_slash_command::{ ArgumentCompletion, SlashCommand, SlashCommandOutput, SlashCommandOutputSection, SlashCommandResult, @@ -38,7 +38,7 @@ impl SlashCommand for DeltaSlashCommand { _workspace: Option>, _cx: &mut WindowContext, ) -> Task>> { - unimplemented!() + Task::ready(Err(anyhow!("this command does not require argument"))) } fn run(