diff --git a/crates/extension_host/src/extension_host.rs b/crates/extension_host/src/extension_host.rs index 075c68d51a..fd64d3fa59 100644 --- a/crates/extension_host/src/extension_host.rs +++ b/crates/extension_host/src/extension_host.rs @@ -1313,10 +1313,17 @@ impl ExtensionStore { } for snippets_path in &snippets_to_add { - if let Some(snippets_contents) = fs.load(snippets_path).await.log_err() { - proxy - .register_snippet(snippets_path, &snippets_contents) - .log_err(); + match fs + .load(snippets_path) + .await + .with_context(|| format!("Loading snippets from {snippets_path:?}")) + { + Ok(snippets_contents) => { + proxy + .register_snippet(snippets_path, &snippets_contents) + .log_err(); + } + Err(e) => log::error!("Cannot load snippets: {e:#}"), } } } @@ -1331,20 +1338,25 @@ impl ExtensionStore { let extension_path = root_dir.join(extension.manifest.id.as_ref()); let wasm_extension = WasmExtension::load( - extension_path, + &extension_path, &extension.manifest, wasm_host.clone(), &cx, ) - .await; + .await + .with_context(|| format!("Loading extension from {extension_path:?}")); - if let Some(wasm_extension) = wasm_extension.log_err() { - wasm_extensions.push((extension.manifest.clone(), wasm_extension)); - } else { - this.update(cx, |_, cx| { - cx.emit(Event::ExtensionFailedToLoad(extension.manifest.id.clone())) - }) - .ok(); + match wasm_extension { + Ok(wasm_extension) => { + wasm_extensions.push((extension.manifest.clone(), wasm_extension)) + } + Err(e) => { + log::error!("Failed to load extension: {e:#}"); + this.update(cx, |_, cx| { + cx.emit(Event::ExtensionFailedToLoad(extension.manifest.id.clone())) + }) + .ok(); + } } } diff --git a/crates/extension_host/src/headless_host.rs b/crates/extension_host/src/headless_host.rs index dbc9bbfe13..adc9638c29 100644 --- a/crates/extension_host/src/headless_host.rs +++ b/crates/extension_host/src/headless_host.rs @@ -173,9 +173,8 @@ impl HeadlessExtensionStore { return Ok(()); } - let wasm_extension: Arc = Arc::new( - WasmExtension::load(extension_dir.clone(), &manifest, wasm_host.clone(), &cx).await?, - ); + let wasm_extension: Arc = + Arc::new(WasmExtension::load(&extension_dir, &manifest, wasm_host.clone(), &cx).await?); for (language_server_id, language_server_config) in &manifest.language_servers { for language in language_server_config.languages() { diff --git a/crates/extension_host/src/wasm_host.rs b/crates/extension_host/src/wasm_host.rs index 3971fa4263..3e0f06fa38 100644 --- a/crates/extension_host/src/wasm_host.rs +++ b/crates/extension_host/src/wasm_host.rs @@ -715,7 +715,7 @@ fn parse_wasm_extension_version_custom_section(data: &[u8]) -> Option, wasm_host: Arc, cx: &AsyncApp,