From bfbb18476f73c2aa912bb1deb8fe12d28f93ee8f Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 12 Aug 2025 10:26:56 -0700 Subject: [PATCH] Fix management of rust-analyzer binaries on windows (#36056) Closes https://github.com/zed-industries/zed/issues/34472 * Avoid removing the just-downloaded exe * Invoke exe within nested version directory Release Notes: - Fix issue where Rust-analyzer was not installed correctly on windows Co-authored-by: Lukas Wirth --- crates/languages/src/rust.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/languages/src/rust.rs b/crates/languages/src/rust.rs index e79f0c9e8e..3baaec1842 100644 --- a/crates/languages/src/rust.rs +++ b/crates/languages/src/rust.rs @@ -238,7 +238,7 @@ impl LspAdapter for RustLspAdapter { ) .await?; make_file_executable(&server_path).await?; - remove_matching(&container_dir, |path| server_path != path).await; + remove_matching(&container_dir, |path| path != destination_path).await; GithubBinaryMetadata::write_to_file( &GithubBinaryMetadata { metadata_version: 1, @@ -1023,8 +1023,14 @@ async fn get_cached_server_binary(container_dir: PathBuf) -> Option path.clone(), // Tar and gzip extract in place. + AssetKind::Zip => path.clone().join("rust-analyzer.exe"), // zip contains a .exe + }; + anyhow::Ok(LanguageServerBinary { - path: last.context("no cached binary")?, + path, env: None, arguments: Default::default(), })