diff --git a/Cargo.lock b/Cargo.lock index 97a8b69..cf8f5ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -449,7 +449,7 @@ dependencies = [ [[package]] name = "zed_biome" -version = "0.1.1" +version = "0.1.2" dependencies = [ "log", "tracing", diff --git a/Cargo.toml b/Cargo.toml index 5b44de8..892fc36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ edition = "2021" license = "MIT" name = "zed_biome" publish = false -version = "0.1.1" +version = "0.1.2" [lib] crate-type = ["cdylib"] diff --git a/extension.toml b/extension.toml index 75ef800..011b1e9 100644 --- a/extension.toml +++ b/extension.toml @@ -4,7 +4,7 @@ id = "biome" name = "Biome" repository = "https://github.com/biomejs/biome-zed" schema_version = 1 -version = "0.1.1" +version = "0.1.2" [language_servers.biome] code_actions_kind = ["", "quickfix"] diff --git a/src/biome.rs b/src/biome.rs index 8f0ed38..407ec55 100644 --- a/src/biome.rs +++ b/src/biome.rs @@ -39,17 +39,6 @@ impl BiomeExtension { )) } - fn resolve_binary(&self, root_path: &str) -> Result { - let specifier = self.binary_specifier()?; - let local_binary_path = Path::new(root_path).join("node_modules").join(specifier); - - if local_binary_path.exists() { - Ok(local_binary_path) - } else { - Err("Error: biome binary not found".to_string()) - } - } - fn server_script_path( &mut self, language_server_id: &LanguageServerId, @@ -83,7 +72,7 @@ impl BiomeExtension { &zed::LanguageServerInstallationStatus::CheckingForUpdate, ); - let fallback_server_path = &self.resolve_binary("./")?; + let fallback_server_path = &Path::new("./node_modules").join(self.binary_specifier()?); let version = zed::npm_package_latest_version(PACKAGE_NAME)?; if !self.server_exists(fallback_server_path) @@ -104,7 +93,9 @@ impl BiomeExtension { } Err(error) => { if !self.server_exists(fallback_server_path) { - Err(error)?; + Err(format!( + "failed to install package '{PACKAGE_NAME}': {error}" + ))?; } } }