Report editor open and save events to Amplitude

Co-authored-by: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Nathan Sobo 2022-09-26 18:18:34 -06:00
parent f0c50c1e0a
commit 824fdb54e6
8 changed files with 137 additions and 35 deletions

View file

@ -410,6 +410,7 @@ impl Item for Editor {
let buffers = buffer.read(cx).all_buffers();
let mut timeout = cx.background().timer(FORMAT_TIMEOUT).fuse();
let format = project.update(cx, |project, cx| project.format(buffers, true, cx));
self.report_event("save editor", cx);
cx.spawn(|_, mut cx| async move {
let transaction = futures::select_biased! {
_ = timeout => {