Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
python: Fix ty binary path and required args (#38458)
Derek Nguyen9e6f1d5a6eac
diff --git a/crates/languages/src/python.rs b/crates/languages/src/python.rsindex d6d22399b4b..a8824d3776b 100644--- a/crates/languages/src/python.rs+++ b/crates/languages/src/python.rs@@ -100,7 +100,7 @@ pub struct TyLspAdapter {#[cfg(target_os = "macos")]impl TyLspAdapter {- const GITHUB_ASSET_KIND: AssetKind = AssetKind::Gz;+ const GITHUB_ASSET_KIND: AssetKind = AssetKind::TarGz;const ARCH_SERVER_NAME: &str = "apple-darwin";}@@ -216,15 +216,20 @@ impl LspInstaller for TyLspAdapter {digest: expected_digest,} = latest_version;let destination_path = container_dir.join(format!("ty-{name}"));++ async_fs::create_dir_all(&destination_path).await?;+let server_path = match Self::GITHUB_ASSET_KIND {- AssetKind::TarGz | AssetKind::Gz => destination_path.clone(), // Tar and gzip extract in place.- AssetKind::Zip => destination_path.clone().join("ty.exe"), // zip contains a .exe+ AssetKind::TarGz | AssetKind::Gz => destination_path+ .join(Self::build_asset_name()?.0)+ .join("ty"),+ AssetKind::Zip => destination_path.clone().join("ty.exe"),};let binary = LanguageServerBinary {path: server_path.clone(),env: None,- arguments: Default::default(),+ arguments: vec!["server".into()],};let metadata_path = destination_path.with_extension("metadata");@@ -283,7 +288,7 @@ impl LspInstaller for TyLspAdapter {Ok(LanguageServerBinary {path: server_path,env: None,- arguments: Default::default(),+ arguments: vec!["server".into()],})}@@ -305,14 +310,16 @@ impl LspInstaller for TyLspAdapter {let path = last.context("no cached binary")?;let path = match TyLspAdapter::GITHUB_ASSET_KIND {- AssetKind::TarGz | AssetKind::Gz => path, // Tar and gzip extract in place.- AssetKind::Zip => path.join("ty.exe"), // zip contains a .exe+ AssetKind::TarGz | AssetKind::Gz => {+ path.join(Self::build_asset_name()?.0).join("ty")+ }+ AssetKind::Zip => path.join("ty.exe"),};anyhow::Ok(LanguageServerBinary {path,env: None,- arguments: Default::default(),+ arguments: vec!["server".into()],})}).await