Add a SlashCommandResult
type alias (#19633)
This PR adds a new `SlashCommandResult` type alias. We're going to be changing what slash commands can return in order to support streaming, so having this type alias in place will make that switch a bit more neat. Release Notes: - N/A
This commit is contained in:
parent
8bfd27b00b
commit
9c0dba4ce1
21 changed files with 87 additions and 54 deletions
|
@ -1,7 +1,9 @@
|
|||
use super::{SlashCommand, SlashCommandOutput};
|
||||
use crate::prompt_library::PromptStore;
|
||||
use anyhow::{anyhow, Context, Result};
|
||||
use assistant_slash_command::{ArgumentCompletion, SlashCommandOutputSection};
|
||||
use assistant_slash_command::{
|
||||
ArgumentCompletion, SlashCommand, SlashCommandOutput, SlashCommandOutputSection,
|
||||
SlashCommandResult,
|
||||
};
|
||||
use gpui::{Task, WeakView};
|
||||
use language::{BufferSnapshot, LspAdapterDelegate};
|
||||
use std::sync::{atomic::AtomicBool, Arc};
|
||||
|
@ -61,7 +63,7 @@ impl SlashCommand for PromptSlashCommand {
|
|||
_workspace: WeakView<Workspace>,
|
||||
_delegate: Option<Arc<dyn LspAdapterDelegate>>,
|
||||
cx: &mut WindowContext,
|
||||
) -> Task<Result<SlashCommandOutput>> {
|
||||
) -> Task<SlashCommandResult> {
|
||||
let title = arguments.to_owned().join(" ");
|
||||
if title.trim().is_empty() {
|
||||
return Task::ready(Err(anyhow!("missing prompt name")));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue