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
17 changed files with 29 additions and 28 deletions
@@ -242,7 +242,7 @@ impl SlashCommand for DocsSlashCommand {
self: Arc<Self>,
argument: Option<&str>,
_workspace: WeakView<Workspace>,
_delegate: Arc<dyn LspAdapterDelegate>,
_delegate: Option<Arc<dyn LspAdapterDelegate>>,
cx: &mut WindowContext,
) -> Task<Result<SlashCommandOutput>> {
let Some(argument) = argument else {