From f31cb90235883e2a6bc06f927052dac4d395bf79 Mon Sep 17 00:00:00 2001 From: luckydye Date: Sat, 19 Oct 2024 19:26:42 +0200 Subject: [PATCH] fix: windows absolute path not converted correctly, use relative path instead --- src/biome.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/biome.rs b/src/biome.rs index 4c2b877..c9de3cf 100644 --- a/src/biome.rs +++ b/src/biome.rs @@ -1,7 +1,4 @@ -use std::{ - env, - path::{Path, PathBuf}, -}; +use std::path::{Path, PathBuf}; use zed::settings::LspSettings; use zed_extension_api::{ self as zed, @@ -181,14 +178,11 @@ impl zed::Extension for BiomeExtension { return Err(err); } - let server_path = Path::new(env::current_dir().unwrap().as_os_str()) - .join("./node_modules") - .join(self.binary_specifier()?) - .to_string_lossy() - .to_string(); + let mut server_path = PathBuf::from("./node_modules"); + server_path.push(self.binary_specifier()?); Ok(zed::Command { - command: server_path, + command: server_path.to_string_lossy().to_string(), args, env: Default::default(), })