From ba1fc41d1416d8a3e1092448080c475cedb13fdf Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 13 Nov 2024 15:11:50 -0800 Subject: [PATCH] Fix completions for non-built-in slash commands (#20632) Release Notes: - N/A Co-authored-by: Marshall --- crates/assistant/src/slash_command.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/assistant/src/slash_command.rs b/crates/assistant/src/slash_command.rs index 833b42e7566e0d9c99cb5d87627b50188810dfdd..9ff4eb094f08cf520d737622c47554f2d02d20c6 100644 --- a/crates/assistant/src/slash_command.rs +++ b/crates/assistant/src/slash_command.rs @@ -2,7 +2,7 @@ use crate::assistant_panel::ContextEditor; use crate::SlashCommandWorkingSet; use anyhow::Result; use assistant_slash_command::AfterCompletion; -pub use assistant_slash_command::{SlashCommand, SlashCommandOutput, SlashCommandRegistry}; +pub use assistant_slash_command::{SlashCommand, SlashCommandOutput}; use editor::{CompletionProvider, Editor}; use fuzzy::{match_strings, StringMatchCandidate}; use gpui::{AppContext, Model, Task, ViewContext, WeakView, WindowContext}; @@ -171,8 +171,7 @@ impl SlashCommandCompletionProvider { let mut flag = self.cancel_flag.lock(); flag.store(true, SeqCst); *flag = new_cancel_flag.clone(); - let commands = SlashCommandRegistry::global(cx); - if let Some(command) = commands.command(command_name) { + if let Some(command) = self.slash_commands.command(command_name, cx) { let completions = command.complete_argument( arguments, new_cancel_flag.clone(),