From a15b10986a70c9b2fdff48926ffe55a6edc17337 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Mon, 7 Oct 2024 16:17:43 -0400 Subject: [PATCH] Add ssh initialization events (#18831) Release Notes: - N/A --- crates/client/src/telemetry.rs | 6 +++--- crates/recent_projects/src/dev_servers.rs | 17 ++++++++++++++++- crates/workspace/src/workspace.rs | 6 ++++++ crates/zed/src/main.rs | 2 ++ 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/crates/client/src/telemetry.rs b/crates/client/src/telemetry.rs index ee6da64d22..a8912c2f20 100644 --- a/crates/client/src/telemetry.rs +++ b/crates/client/src/telemetry.rs @@ -485,7 +485,7 @@ impl Telemetry { worktree_id: WorktreeId, updated_entries_set: &UpdatedEntriesSet, ) { - let project_names: Vec = { + let project_type_names: Vec = { let mut state = self.state.lock(); state .worktree_id_map @@ -521,8 +521,8 @@ impl Telemetry { }; // Done on purpose to avoid calling `self.state.lock()` multiple times - for project_name in project_names { - self.report_app_event(format!("open {} project", project_name)); + for project_type_name in project_type_names { + self.report_app_event(format!("open {} project", project_type_name)); } } diff --git a/crates/recent_projects/src/dev_servers.rs b/crates/recent_projects/src/dev_servers.rs index 0a05b6a1e9..fa1d511791 100644 --- a/crates/recent_projects/src/dev_servers.rs +++ b/crates/recent_projects/src/dev_servers.rs @@ -279,6 +279,13 @@ impl DevServerProjects { match connection.await { Some(_) => this .update(&mut cx, |this, cx| { + let _ = this.workspace.update(cx, |workspace, _| { + workspace + .client() + .telemetry() + .report_app_event("create ssh server".to_string()) + }); + this.add_ssh_server(connection_options, cx); this.mode = Mode::Default(None); cx.notify() @@ -422,7 +429,15 @@ impl DevServerProjects { ); cx.new_view(|cx| { - Workspace::new(None, project.clone(), app_state.clone(), cx) + let workspace = + Workspace::new(None, project.clone(), app_state.clone(), cx); + + workspace + .client() + .telemetry() + .report_app_event("create ssh project".to_string()); + + workspace }) }) .log_err(); diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index d2ccd9cd4a..814c7fa915 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -5575,6 +5575,12 @@ pub fn open_ssh_project( cx.replace_root_view(|cx| { let mut workspace = Workspace::new(Some(workspace_id), project, app_state.clone(), cx); + + workspace + .client() + .telemetry() + .report_app_event("open ssh project".to_string()); + workspace.set_serialized_ssh_project(serialized_ssh_project); workspace }); diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index adb5feb9fe..535cafbccb 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -528,6 +528,8 @@ fn main() { session_id, cx, ); + + // We should rename these in the future to `first app open`, `first app open for release channel`, and `app open` if let (Some(system_id), Some(installation_id)) = (&system_id, &installation_id) { match (&system_id, &installation_id) { (IdType::New(_), IdType::New(_)) => {