From 4c7a6f5e7fdabb2a5daa65fd5f1f5b87b1ab2f65 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Tue, 8 Oct 2024 10:30:04 -0400 Subject: [PATCH] Add is_via_ssh field to editor events (#18837) Release Notes: - N/A --- crates/client/src/telemetry.rs | 2 ++ crates/collab/src/api/events.rs | 2 ++ crates/editor/src/editor.rs | 4 +++- crates/telemetry_events/src/telemetry_events.rs | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/client/src/telemetry.rs b/crates/client/src/telemetry.rs index a8912c2f20..24d448aa02 100644 --- a/crates/client/src/telemetry.rs +++ b/crates/client/src/telemetry.rs @@ -364,6 +364,7 @@ impl Telemetry { operation: &'static str, copilot_enabled: bool, copilot_enabled_for_language: bool, + is_via_ssh: bool, ) { let event = Event::Editor(EditorEvent { file_extension, @@ -371,6 +372,7 @@ impl Telemetry { operation: operation.into(), copilot_enabled, copilot_enabled_for_language, + is_via_ssh, }); self.report_event(event) diff --git a/crates/collab/src/api/events.rs b/crates/collab/src/api/events.rs index bbfa69c0b8..f5cd1c00ea 100644 --- a/crates/collab/src/api/events.rs +++ b/crates/collab/src/api/events.rs @@ -679,6 +679,7 @@ pub struct EditorEventRow { minor: Option, patch: Option, checksum_matched: bool, + is_via_ssh: bool, } impl EditorEventRow { @@ -720,6 +721,7 @@ impl EditorEventRow { region_code: "".to_string(), city: "".to_string(), historical_event: false, + is_via_ssh: event.is_via_ssh, } } } diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 62c2240828..d06f66184b 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -12481,13 +12481,15 @@ impl Editor { .settings_at(0, cx) .show_inline_completions; - let telemetry = project.read(cx).client().telemetry().clone(); + let project = project.read(cx); + let telemetry = project.client().telemetry().clone(); telemetry.report_editor_event( file_extension, vim_mode, operation, copilot_enabled, copilot_enabled_for_language, + project.is_via_ssh(), ) } diff --git a/crates/telemetry_events/src/telemetry_events.rs b/crates/telemetry_events/src/telemetry_events.rs index 56e94edb44..a42b8cc8b5 100644 --- a/crates/telemetry_events/src/telemetry_events.rs +++ b/crates/telemetry_events/src/telemetry_events.rs @@ -117,6 +117,8 @@ pub struct EditorEvent { pub copilot_enabled: bool, /// Whether the user has copilot enabled for the language of the file opened or saved pub copilot_enabled_for_language: bool, + /// Whether the client is editing a local file or a remote file via SSH + pub is_via_ssh: bool, } /// Deprecated since Zed v0.137.0 (2024-05-29). Replaced by InlineCompletionEvent.