From f9662f484d32116f1a875791e36bd10490a14b66 Mon Sep 17 00:00:00 2001 From: Matthew Chisolm <39521893+mchisolm0@users.noreply.github.com> Date: Thu, 16 Apr 2026 02:45:38 -0500 Subject: [PATCH] feedback: Add action for listing installed extensions (#48664) Closes #48037 - [X] Tests or screenshots needed? <--- Let me know if tests are needed - [ ] Code Reviewed - [X] Manual QA Release Notes: - Added action to copy installed extensions to clipboard
Picture of ActionScreenshot from 2026-03-03 01-00-22
Picture of Modal Screenshot from 2026-03-03
01-00-35
Picture of Docs Screenshot from 2026-03-03
01-19-53
--------- Co-authored-by: MrSubidubi --- Cargo.lock | 1 + crates/feedback/Cargo.toml | 1 + crates/feedback/src/feedback.rs | 43 +++++++++++++++++++++++++++++++++ docs/src/troubleshooting.md | 1 + 4 files changed, 46 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index ccf29c1b29318a785175b7f67b575ec95d8866c9..32024536dbcf6c4c004f151ba8f6e837fee767f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6183,6 +6183,7 @@ dependencies = [ name = "feedback" version = "0.1.0" dependencies = [ + "extension_host", "gpui", "system_specs", "urlencoding", diff --git a/crates/feedback/Cargo.toml b/crates/feedback/Cargo.toml index c2279d778865cb819a5b0e2e494ad9d1e4470067..6a595bf4ee4645e9d05a605e1d60d411e13c38c0 100644 --- a/crates/feedback/Cargo.toml +++ b/crates/feedback/Cargo.toml @@ -15,6 +15,7 @@ path = "src/feedback.rs" test-support = [] [dependencies] +extension_host.workspace = true gpui.workspace = true system_specs.workspace = true urlencoding.workspace = true diff --git a/crates/feedback/src/feedback.rs b/crates/feedback/src/feedback.rs index 57bddb6ae7ee19e4b6df8fcf7ebcaeb32e5105bb..4a9f92d6d26b68c47c8c8faccf337f136d46cbd9 100644 --- a/crates/feedback/src/feedback.rs +++ b/crates/feedback/src/feedback.rs @@ -1,3 +1,4 @@ +use extension_host::ExtensionStore; use gpui::{App, ClipboardItem, PromptLevel, actions}; use system_specs::{CopySystemSpecsIntoClipboard, SystemSpecs}; use util::ResultExt; @@ -9,6 +10,8 @@ actions!( [ /// Opens the Zed repository on GitHub. OpenZedRepo, + /// Copies installed extensions to the clipboard for bug reports. + CopyInstalledExtensionsIntoClipboard ] ); @@ -65,6 +68,17 @@ pub fn init(cx: &mut App) { }) .detach(); }) + .register_action(|_, _: &CopyInstalledExtensionsIntoClipboard, window, cx| { + let clipboard_text = format_installed_extensions_for_clipboard(cx); + cx.write_to_clipboard(ClipboardItem::new_string(clipboard_text.clone())); + drop(window.prompt( + PromptLevel::Info, + "Copied into clipboard", + Some(&clipboard_text), + &["OK"], + cx, + )); + }) .register_action(|_, _: &RequestFeature, _, cx| { cx.open_url(REQUEST_FEATURE_URL); }) @@ -96,3 +110,32 @@ pub fn init(cx: &mut App) { }) .detach(); } + +fn format_installed_extensions_for_clipboard(cx: &mut App) -> String { + let store = ExtensionStore::global(cx); + let store = store.read(cx); + let mut lines = Vec::with_capacity(store.extension_index.extensions.len()); + + for (extension_id, entry) in store.extension_index.extensions.iter() { + let line = format!( + "- {} ({}) v{}{}", + entry.manifest.name, + extension_id, + entry.manifest.version, + if entry.dev { " (dev)" } else { "" } + ); + lines.push(line); + } + + lines.sort(); + + if lines.is_empty() { + return "No extensions installed.".to_string(); + } + + format!( + "Installed extensions ({}):\n{}", + lines.len(), + lines.join("\n") + ) +} diff --git a/docs/src/troubleshooting.md b/docs/src/troubleshooting.md index 0ec95cd55e0d127e82430670de9290ec793deb5d..9ef5cc9f3218b311e7795bf6bf7000f139c9c908 100644 --- a/docs/src/troubleshooting.md +++ b/docs/src/troubleshooting.md @@ -17,6 +17,7 @@ When reporting issues or seeking help, it's useful to know your Zed version and - {#action zed::About}: Find your Zed version number - {#action zed::CopySystemSpecsIntoClipboard}: Populate your clipboard with Zed version number, operating system version, and hardware specs +- {#action zed::CopyInstalledExtensionsIntoClipboard}: Populate your clipboard with a list of your installed extensions and versions ## Zed Log