diff --git a/crates/copilot/src/copilot.rs b/crates/copilot/src/copilot.rs index 097f3187b8..cf531de418 100644 --- a/crates/copilot/src/copilot.rs +++ b/crates/copilot/src/copilot.rs @@ -16,17 +16,18 @@ pub fn init(client: Arc, cx: &mut MutableAppContext) { }); } +#[derive(Debug)] struct Copilot { copilot_server: PathBuf, } impl Copilot { fn sign_in(http: Arc, cx: &mut MutableAppContext) { - let copilot = cx.global::>>().clone(); + let maybe_copilot = cx.default_global::>>().clone(); cx.spawn(|mut cx| async move { // Lazily download / initialize copilot LSP - let copilot = if let Some(copilot) = copilot { + let copilot = if let Some(copilot) = maybe_copilot { copilot } else { let copilot_server = get_lsp_binary(http).await?; // TODO: Make this error user visible @@ -38,6 +39,8 @@ impl Copilot { new_copilot }; + dbg!(copilot); + Ok(()) }) .detach(); diff --git a/crates/util/src/github.rs b/crates/util/src/github.rs index 33c0ea6a1a..02082108e1 100644 --- a/crates/util/src/github.rs +++ b/crates/util/src/github.rs @@ -34,6 +34,7 @@ pub async fn latest_github_release( .read_to_end(&mut body) .await .context("error reading latest release")?; + let release: GithubRelease = serde_json::from_slice(body.as_slice()).context("error deserializing latest release")?; Ok(release)