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 <lukas@zed.dev>
This commit is contained in:
parent
978b75bba9
commit
bfbb18476f
1 changed files with 8 additions and 2 deletions
|
@ -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<LanguageServ
|
|||
last = Some(path);
|
||||
}
|
||||
|
||||
let path = last.context("no cached binary")?;
|
||||
let path = match RustLspAdapter::GITHUB_ASSET_KIND {
|
||||
AssetKind::TarGz | AssetKind::Gz => 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(),
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue