assistant: Don't require a worktree to run slash commands (#15655)

This PR fixes an issue where slash commands were not able to run when
Zed did not have any worktrees opened.

This requirement was only necessary for slash commands originating from
extensions, and we can enforce the presence of a worktree just for
those:

<img width="378" alt="Screenshot 2024-08-01 at 5 01 58 PM"
src="https://github.com/user-attachments/assets/38bea947-e33b-4c64-853c-c1f36c63d779">

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-08-01 17:14:13 -04:00 committed by GitHub
parent 55fc1f0afb
commit 88f29c8355
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 29 additions and 28 deletions

View file

@ -49,7 +49,7 @@ pub trait SlashCommand: 'static + Send + Sync {
//
// It may be that `LspAdapterDelegate` needs a more general name, or
// perhaps another kind of delegate is needed here.
delegate: Arc<dyn LspAdapterDelegate>,
delegate: Option<Arc<dyn LspAdapterDelegate>>,
cx: &mut WindowContext,
) -> Task<Result<SlashCommandOutput>>;
}