assistant: Add /now slash command (#12856)

This PR adds a `/now` command to the Assistant for indicating the
current date and time to the model.

Release Notes:

- Added `/now` command to the Assistant for getting the current date and
time.
This commit is contained in:
Marshall Bowers 2024-06-10 14:05:02 -04:00 committed by GitHub
parent a600799840
commit 0d5485bd6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 87 additions and 2 deletions

View file

@ -25,8 +25,8 @@ use semantic_index::{CloudEmbeddingProvider, SemanticIndex};
use serde::{Deserialize, Serialize};
use settings::{Settings, SettingsStore};
use slash_command::{
active_command, default_command, fetch_command, file_command, project_command, prompt_command,
rustdoc_command, search_command, tabs_command,
active_command, default_command, fetch_command, file_command, now_command, project_command,
prompt_command, rustdoc_command, search_command, tabs_command,
};
use std::{
fmt::{self, Display},
@ -307,6 +307,7 @@ fn register_slash_commands(cx: &mut AppContext) {
slash_command_registry.register_command(search_command::SearchSlashCommand, true);
slash_command_registry.register_command(prompt_command::PromptSlashCommand, true);
slash_command_registry.register_command(default_command::DefaultSlashCommand, true);
slash_command_registry.register_command(now_command::NowSlashCommand, true);
slash_command_registry.register_command(rustdoc_command::RustdocSlashCommand, false);
slash_command_registry.register_command(fetch_command::FetchSlashCommand, false);
}