Pull app / OS info out of GPUI, add Linux information, make fallible window initialization (#12869)

TODO:
- [x] Finish GPUI changes on other operating systems 

This is a largely internal change to how we report data to our
diagnostics and telemetry. This PR also includes an update to our blade
backend which allows us to report errors in a more useful way when
failing to initialize blade.


Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Mikayla Maki 2024-06-11 11:43:12 -07:00 committed by GitHub
parent ec9e700e70
commit 80c14c9198
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 571 additions and 550 deletions

View file

@ -4853,18 +4853,16 @@ pub fn open_new(
app_state: Arc<AppState>,
cx: &mut AppContext,
init: impl FnOnce(&mut Workspace, &mut ViewContext<Workspace>) + 'static + Send,
) -> Task<()> {
) -> Task<anyhow::Result<()>> {
let task = Workspace::new_local(Vec::new(), app_state, None, cx);
cx.spawn(|mut cx| async move {
if let Some((workspace, opened_paths)) = task.await.log_err() {
workspace
.update(&mut cx, |workspace, cx| {
if opened_paths.is_empty() {
init(workspace, cx)
}
})
.log_err();
}
let (workspace, opened_paths) = task.await?;
workspace.update(&mut cx, |workspace, cx| {
if opened_paths.is_empty() {
init(workspace, cx)
}
})?;
Ok(())
})
}
@ -4936,7 +4934,7 @@ pub fn join_hosted_project(
Workspace::new(Default::default(), project, app_state.clone(), cx)
})
})
})?
})??
};
workspace.update(&mut cx, |_, cx| {
@ -5011,7 +5009,7 @@ pub fn join_dev_server_project(
Workspace::new(Some(workspace_id), project, app_state.clone(), cx)
})
})
})?
})??
}
};
@ -5074,7 +5072,7 @@ pub fn join_in_room_project(
Workspace::new(Default::default(), project, app_state.clone(), cx)
})
})
})?
})??
};
workspace.update(&mut cx, |workspace, cx| {