From c60a7034c8940ae3105c7fdfc3d3ad57af275ec5 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 20 Mar 2025 12:36:40 -0400 Subject: [PATCH] context_server: Interpret context server command paths relative to the extension's work dir (#27201) This PR fixes an issues where the commands returned from context server extensions were being used as-is instead of interpreting them relative to the extension's work dir. Release Notes: - Fixed an issue with context server paths not being interpreted relative to the extension's work dir. --------- Co-authored-by: Max Brunsfeld Co-authored-by: Thomas Mickley-Doyle --- crates/context_server/src/extension_context_server.rs | 6 +++++- crates/extension_host/src/extension_host.rs | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/context_server/src/extension_context_server.rs b/crates/context_server/src/extension_context_server.rs index 96d1ccaf53..90ddc1609a 100644 --- a/crates/context_server/src/extension_context_server.rs +++ b/crates/context_server/src/extension_context_server.rs @@ -51,9 +51,13 @@ impl ExtensionContextServerProxy for ContextServerFactoryRegistryProxy { }) })?; - let command = extension + let mut command = extension .context_server_command(id.clone(), extension_project) .await?; + command.command = extension + .path_from_extension(command.command.as_ref()) + .to_string_lossy() + .to_string(); log::info!("loaded command for context server {id}: {command:?}"); diff --git a/crates/extension_host/src/extension_host.rs b/crates/extension_host/src/extension_host.rs index a0fa34b38b..36f1f2960c 100644 --- a/crates/extension_host/src/extension_host.rs +++ b/crates/extension_host/src/extension_host.rs @@ -906,7 +906,10 @@ impl ExtensionStore { .await } }) - .await?; + .await + .inspect_err(|error| { + util::log_err(error); + })?; let output_path = &extensions_dir.join(extension_id.as_ref()); if let Some(metadata) = fs.metadata(output_path).await? {