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.

Show telemetry for adding all items (#40541)

Mikayla Makid7e193caf36a
diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs
index ebb55f4a756..0784f30739b 100644
--- a/crates/workspace/src/pane.rs
+++ b/crates/workspace/src/pane.rs
@@ -954,6 +954,11 @@ impl Pane {
if allow_preview {
pane.set_preview_item_id(Some(new_item.item_id()), cx);
}
+
+ if let Some(text) = new_item.telemetry_event_text(cx) {
+ telemetry::event!(text);
+ }
+
pane.add_item_inner(
new_item,
true,
@@ -1170,6 +1175,10 @@ impl Pane {
window: &mut Window,
cx: &mut Context<Self>,
) {
+ if let Some(text) = item.telemetry_event_text(cx) {
+ telemetry::event!(text);
+ }
+
self.add_item_inner(
item,
activate_pane,
diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs
index e7942a3d86e..bbb9ee76719 100644
--- a/crates/workspace/src/workspace.rs
+++ b/crates/workspace/src/workspace.rs
@@ -3294,10 +3294,6 @@ impl Workspace {
window: &mut Window,
cx: &mut App,
) {
- if let Some(text) = item.telemetry_event_text(cx) {
- telemetry::event!(text);
- }
-
pane.update(cx, |pane, cx| {
pane.add_item(
item,