Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Make fetch slash command visible in the command selector (#21302)

Danilo Lealae85ecba2d54
diff --git a/assets/icons/globe.svg b/assets/icons/globe.svg
new file mode 100644
index 00000000000..2082a43984a
--- /dev/null
+++ b/assets/icons/globe.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-globe"><circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/></svg>
diff --git a/crates/assistant/src/assistant.rs b/crates/assistant/src/assistant.rs
index 7e4e38e3205..6d619a76b92 100644
--- a/crates/assistant/src/assistant.rs
+++ b/crates/assistant/src/assistant.rs
@@ -342,8 +342,7 @@ fn register_slash_commands(prompt_builder: Option<Arc<PromptBuilder>>, cx: &mut
slash_command_registry.register_command(terminal_command::TerminalSlashCommand, true);
slash_command_registry.register_command(now_command::NowSlashCommand, false);
slash_command_registry.register_command(diagnostics_command::DiagnosticsSlashCommand, true);
- slash_command_registry.register_command(fetch_command::FetchSlashCommand, false);
- slash_command_registry.register_command(fetch_command::FetchSlashCommand, false);
+ slash_command_registry.register_command(fetch_command::FetchSlashCommand, true);
if let Some(prompt_builder) = prompt_builder {
cx.observe_flag::<project_command::ProjectSlashCommandFeatureFlag, _>({
diff --git a/crates/assistant/src/slash_command/fetch_command.rs b/crates/assistant/src/slash_command/fetch_command.rs
index 4d38bb20a7b..96ea05c3023 100644
--- a/crates/assistant/src/slash_command/fetch_command.rs
+++ b/crates/assistant/src/slash_command/fetch_command.rs
@@ -108,6 +108,10 @@ impl SlashCommand for FetchSlashCommand {
"Insert fetched URL contents".into()
}
+ fn icon(&self) -> IconName {
+ IconName::Globe
+ }
+
fn menu_text(&self) -> String {
self.description()
}
@@ -162,7 +166,7 @@ impl SlashCommand for FetchSlashCommand {
text,
sections: vec![SlashCommandOutputSection {
range,
- icon: IconName::AtSign,
+ icon: IconName::Globe,
label: format!("fetch {}", url).into(),
metadata: None,
}],
diff --git a/crates/ui/src/components/icon.rs b/crates/ui/src/components/icon.rs
index 161f4c60b7e..03000f06387 100644
--- a/crates/ui/src/components/icon.rs
+++ b/crates/ui/src/components/icon.rs
@@ -160,7 +160,6 @@ pub enum IconName {
Copy,
CountdownTimer,
CursorIBeam,
- TextSnippet,
Dash,
DatabaseZap,
Delete,
@@ -171,8 +170,8 @@ pub enum IconName {
EllipsisVertical,
Envelope,
Escape,
- Exit,
ExpandVertical,
+ Exit,
ExternalLink,
Eye,
File,
@@ -198,6 +197,7 @@ pub enum IconName {
GenericMinimize,
GenericRestore,
Github,
+ Globe,
Hash,
HistoryRerun,
Indicator,
@@ -223,13 +223,13 @@ pub enum IconName {
PageUp,
Pencil,
Person,
+ PhoneIncoming,
Pin,
Play,
Plus,
PocketKnife,
Public,
PullRequest,
- PhoneIncoming,
Quote,
RefreshTitle,
Regex,
@@ -275,6 +275,7 @@ pub enum IconName {
SwatchBook,
Tab,
Terminal,
+ TextSnippet,
Trash,
TrashAlt,
Triangle,
@@ -287,11 +288,11 @@ pub enum IconName {
Wand,
Warning,
WholeWord,
+ X,
XCircle,
ZedAssistant,
ZedAssistantFilled,
ZedXCopilot,
- X,
}
impl From<IconName> for Icon {