mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-03 17:44:30 +00:00
ruff: Fix wrong Ruff path on Windows (#17883)
Log: 2024-09-16T22:32:04.7715712+08:00 [ERROR] failed to start language server "ruff": failed to spawn command. path: "...\\AppData\\Local\\Zed\\extensions\\work\\ruff\\ruff-0.6.5\\ruff-x86_64-pc-windows-msvc\\ruff" The right path: `...\\AppData\\Local\\Zed\\extensions\\work\\ruff\\ruff-0.6.5\\ruff.exe` Release Notes: - N/A
This commit is contained in:
parent
e6c4076ef0
commit
fc43b21e78
1 changed files with 4 additions and 1 deletions
|
@ -89,7 +89,10 @@ impl RuffExtension {
|
||||||
.ok_or_else(|| format!("no asset found matching {:?}", asset_name))?;
|
.ok_or_else(|| format!("no asset found matching {:?}", asset_name))?;
|
||||||
|
|
||||||
let version_dir = format!("ruff-{}", release.version);
|
let version_dir = format!("ruff-{}", release.version);
|
||||||
let binary_path = format!("{version_dir}/{asset_stem}/ruff");
|
let binary_path = match platform {
|
||||||
|
zed::Os::Windows => format!("{version_dir}/ruff.exe"),
|
||||||
|
_ => format!("{version_dir}/{asset_stem}/ruff"),
|
||||||
|
};
|
||||||
|
|
||||||
if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) {
|
if !fs::metadata(&binary_path).map_or(false, |stat| stat.is_file()) {
|
||||||
zed::set_language_server_installation_status(
|
zed::set_language_server_installation_status(
|
||||||
|
|
Loading…
Reference in a new issue