Extract ExtensionSlashCommand to assistant_slash_command crate (#20617)

This PR extracts the `ExtensionSlashCommand` implementation to the
`assistant_slash_command` crate.

The slash command related methods have been added to the `Extension`
trait. We also create separate data types for the slash command data
within the `extension` crate so that we can talk about them without
depending on the `extension_host` or `assistant_slash_command`.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-11-13 14:34:58 -05:00 committed by GitHub
parent b913cf2e02
commit 254ce74036
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 309 additions and 161 deletions

View file

@ -1,5 +1,8 @@
mod extension_slash_command;
mod slash_command_registry;
pub use crate::extension_slash_command::*;
pub use crate::slash_command_registry::*;
use anyhow::Result;
use futures::stream::{self, BoxStream};
use futures::StreamExt;
@ -7,7 +10,6 @@ use gpui::{AnyElement, AppContext, ElementId, SharedString, Task, WeakView, Wind
use language::{BufferSnapshot, CodeLabel, LspAdapterDelegate, OffsetRangeExt};
pub use language_model::Role;
use serde::{Deserialize, Serialize};
pub use slash_command_registry::*;
use std::{
ops::Range,
sync::{atomic::AtomicBool, Arc},