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.

Add actions for requesting features and filing bug reports

Joseph Lyons41bff3947c5e
diff --git a/Cargo.lock b/Cargo.lock
index 8bad1349cc9..6ee7abcb707 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -7231,6 +7231,12 @@ dependencies = [
"serde",
]
+[[package]]
+name = "urlencoding"
+version = "2.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e8db7427f936968176eaa7cdf81b7f98b980b18495ec28f1b5791ac3bfe3eea9"
+
[[package]]
name = "usvg"
version = "0.14.1"
@@ -8273,6 +8279,7 @@ dependencies = [
"tree-sitter-typescript",
"unindent",
"url",
+ "urlencoding",
"util",
"vim",
"workspace",
diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml
index 1e3167d2b8d..fc7a1753555 100644
--- a/crates/zed/Cargo.toml
+++ b/crates/zed/Cargo.toml
@@ -110,6 +110,7 @@ tree-sitter-html = "0.19.0"
tree-sitter-scheme = { git = "https://github.com/6cdh/tree-sitter-scheme", rev = "af0fd1fa452cb2562dc7b5c8a8c55551c39273b9"}
tree-sitter-racket = { git = "https://github.com/zed-industries/tree-sitter-racket", rev = "eb010cf2c674c6fd9a6316a84e28ef90190fe51a"}
url = "2.2"
+urlencoding = "2.1.2"
[dev-dependencies]
call = { path = "../call", features = ["test-support"] }
diff --git a/crates/zed/src/menus.rs b/crates/zed/src/menus.rs
index 3865389e99f..b46e8ad7037 100644
--- a/crates/zed/src/menus.rs
+++ b/crates/zed/src/menus.rs
@@ -343,10 +343,12 @@ pub fn menus() -> Vec<Menu<'static>> {
action: Box::new(crate::CopySystemSpecsIntoClipboard),
},
MenuItem::Action {
- name: "Give Feedback",
- action: Box::new(crate::OpenBrowser {
- url: super::feedback::NEW_ISSUE_URL.into(),
- }),
+ name: "File Bug Report",
+ action: Box::new(crate::FileBugReport),
+ },
+ MenuItem::Action {
+ name: "Request Feature",
+ action: Box::new(crate::RequestFeature),
},
MenuItem::Separator,
MenuItem::Action {
diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs
index 0936e317f4a..e6d50f43af8 100644
--- a/crates/zed/src/zed.rs
+++ b/crates/zed/src/zed.rs
@@ -69,7 +69,9 @@ actions!(
ResetBufferFontSize,
InstallCommandLineInterface,
ResetDatabase,
- CopySystemSpecsIntoClipboard
+ CopySystemSpecsIntoClipboard,
+ RequestFeature,
+ FileBugReport
]
);
@@ -261,6 +263,28 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
},
);
+ cx.add_action(
+ |_: &mut Workspace, _: &RequestFeature, cx: &mut ViewContext<Workspace>| {
+ let url = "https://github.com/zed-industries/feedback/issues/new?assignees=&labels=enhancement%2Ctriage&template=0_feature_request.yml";
+ cx.dispatch_action(OpenBrowser {
+ url: url.into(),
+ });
+ },
+ );
+
+ cx.add_action(
+ |_: &mut Workspace, _: &FileBugReport, cx: &mut ViewContext<Workspace>| {
+ let system_specs_text = SystemSpecs::new(cx).to_string();
+ let url = format!(
+ "https://github.com/zed-industries/feedback/issues/new?assignees=&labels=defect%2Ctriage&template=2_bug_report.yml&environment={}",
+ urlencoding::encode(&system_specs_text)
+ );
+ cx.dispatch_action(OpenBrowser {
+ url: url.into(),
+ });
+ },
+ );
+
activity_indicator::init(cx);
call::init(app_state.client.clone(), app_state.user_store.clone(), cx);
settings::KeymapFileContent::load_defaults(cx);