Skip to content

Commit

Permalink
Add is_via_ssh field to editor events (#18837)
Browse files Browse the repository at this point in the history
Release Notes:

- N/A
  • Loading branch information
JosephTLyons authored Oct 8, 2024
1 parent dd44168 commit 4c7a6f5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions crates/client/src/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,15 @@ impl Telemetry {
operation: &'static str,
copilot_enabled: bool,
copilot_enabled_for_language: bool,
is_via_ssh: bool,
) {
let event = Event::Editor(EditorEvent {
file_extension,
vim_mode,
operation: operation.into(),
copilot_enabled,
copilot_enabled_for_language,
is_via_ssh,
});

self.report_event(event)
Expand Down
2 changes: 2 additions & 0 deletions crates/collab/src/api/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@ pub struct EditorEventRow {
minor: Option<i32>,
patch: Option<i32>,
checksum_matched: bool,
is_via_ssh: bool,
}

impl EditorEventRow {
Expand Down Expand Up @@ -720,6 +721,7 @@ impl EditorEventRow {
region_code: "".to_string(),
city: "".to_string(),
historical_event: false,
is_via_ssh: event.is_via_ssh,
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion crates/editor/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
}

Expand Down
2 changes: 2 additions & 0 deletions crates/telemetry_events/src/telemetry_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4c7a6f5

Please sign in to comment.