parent
b17f2089a2
commit
7425d242bc
24 changed files with 179 additions and 140 deletions
|
@ -14,3 +14,4 @@ path = "src/telemetry_events.rs"
|
|||
[dependencies]
|
||||
semantic_version.workspace = true
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use semantic_version::SemanticVersion;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{fmt::Display, sync::Arc, time::Duration};
|
||||
use std::{collections::HashMap, fmt::Display, sync::Arc, time::Duration};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct EventRequestBody {
|
||||
|
@ -91,6 +91,7 @@ impl Display for AssistantPhase {
|
|||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum Event {
|
||||
Flexible(FlexibleEvent),
|
||||
Editor(EditorEvent),
|
||||
InlineCompletion(InlineCompletionEvent),
|
||||
InlineCompletionRating(InlineCompletionRatingEvent),
|
||||
|
@ -106,6 +107,12 @@ pub enum Event {
|
|||
Repl(ReplEvent),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct FlexibleEvent {
|
||||
pub event_type: String,
|
||||
pub event_properties: HashMap<String, serde_json::Value>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct EditorEvent {
|
||||
/// The editor operation performed (open, save)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue