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.

extensions: Add copy author info button in context menu (#27221)

Smit Barmase9134630841f0
diff --git a/crates/extensions_ui/src/extensions_ui.rs b/crates/extensions_ui/src/extensions_ui.rs
index 7fe504655d4..74173460e9e 100644
--- a/crates/extensions_ui/src/extensions_ui.rs
+++ b/crates/extensions_ui/src/extensions_ui.rs
@@ -612,6 +612,7 @@ impl ExtensionsPage {
self.buttons_for_entry(extension, &status, has_dev_extension, cx);
let version = extension.manifest.version.clone();
let repository_url = extension.manifest.repository.clone();
+ let authors = extension.manifest.authors.clone();
let installed_version = match status {
ExtensionStatus::Installed(installed_version) => Some(installed_version),
@@ -749,6 +750,7 @@ impl ExtensionsPage {
Some(Self::render_remote_extension_context_menu(
&this,
extension_id.clone(),
+ authors.clone(),
window,
cx,
))
@@ -761,6 +763,7 @@ impl ExtensionsPage {
fn render_remote_extension_context_menu(
this: &Entity<Self>,
extension_id: Arc<str>,
+ authors: Vec<String>,
window: &mut Window,
cx: &mut App,
) -> Entity<ContextMenu> {
@@ -782,6 +785,12 @@ impl ExtensionsPage {
cx.write_to_clipboard(ClipboardItem::new_string(extension_id.to_string()));
}
})
+ .entry("Copy Author Info", None, {
+ let authors = authors.clone();
+ move |_, cx| {
+ cx.write_to_clipboard(ClipboardItem::new_string(authors.join(", ")));
+ }
+ })
});
context_menu