Extract slash commands to their own crate (#23261)

This PR extracts the slash command definitions out of the `assistant`
crate and into their own `assistant_slash_commands` crate.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-01-16 17:17:07 -05:00 committed by GitHub
parent 1a8303b020
commit 8030c0025a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 452 additions and 347 deletions

View file

@ -1,14 +1,14 @@
use super::{AssistantEdit, MessageCacheMetadata};
use crate::{
assistant_panel, slash_command::file_command, AssistantEditKind, CacheStatus, Context,
ContextEvent, ContextId, ContextOperation, InvokedSlashCommandId, MessageId, MessageStatus,
PromptBuilder,
assistant_panel, AssistantEditKind, CacheStatus, Context, ContextEvent, ContextId,
ContextOperation, InvokedSlashCommandId, MessageId, MessageStatus, PromptBuilder,
};
use anyhow::Result;
use assistant_slash_command::{
ArgumentCompletion, SlashCommand, SlashCommandContent, SlashCommandEvent, SlashCommandOutput,
SlashCommandOutputSection, SlashCommandRegistry, SlashCommandResult, SlashCommandWorkingSet,
};
use assistant_slash_commands::FileSlashCommand;
use assistant_tool::ToolWorkingSet;
use collections::{HashMap, HashSet};
use fs::FakeFs;
@ -407,7 +407,7 @@ async fn test_slash_commands(cx: &mut TestAppContext) {
.await;
let slash_command_registry = cx.update(SlashCommandRegistry::default_global);
slash_command_registry.register_command(file_command::FileSlashCommand, false);
slash_command_registry.register_command(FileSlashCommand, false);
let registry = Arc::new(LanguageRegistry::test(cx.executor()));
let prompt_builder = Arc::new(PromptBuilder::new(None).unwrap());