diff --git a/Cargo.lock b/Cargo.lock index e3a8374eaf..8f27af1216 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13872,7 +13872,7 @@ dependencies = [ name = "zed_php" version = "0.0.6" dependencies = [ - "zed_extension_api 0.0.4", + "zed_extension_api 0.0.6", ] [[package]] diff --git a/extensions/php/Cargo.toml b/extensions/php/Cargo.toml index 9624874e0f..462b8ea4d8 100644 --- a/extensions/php/Cargo.toml +++ b/extensions/php/Cargo.toml @@ -13,4 +13,4 @@ path = "src/php.rs" crate-type = ["cdylib"] [dependencies] -zed_extension_api = "0.0.4" +zed_extension_api = "0.0.6" diff --git a/extensions/php/src/php.rs b/extensions/php/src/php.rs index a0f700e452..d588ed9d8b 100644 --- a/extensions/php/src/php.rs +++ b/extensions/php/src/php.rs @@ -1,5 +1,5 @@ use std::{env, fs}; -use zed_extension_api::{self as zed, Result}; +use zed_extension_api::{self as zed, LanguageServerId, Result}; const SERVER_PATH: &str = "node_modules/intelephense/lib/intelephense.js"; const PACKAGE_NAME: &str = "intelephense"; @@ -13,14 +13,14 @@ impl PhpExtension { fs::metadata(SERVER_PATH).map_or(false, |stat| stat.is_file()) } - fn server_script_path(&mut self, config: zed::LanguageServerConfig) -> Result { + fn server_script_path(&mut self, language_server_id: &LanguageServerId) -> Result { let server_exists = self.server_exists(); if self.did_find_server && server_exists { return Ok(SERVER_PATH.to_string()); } zed::set_language_server_installation_status( - &config.name, + &language_server_id, &zed::LanguageServerInstallationStatus::CheckingForUpdate, ); let version = zed::npm_package_latest_version(PACKAGE_NAME)?; @@ -29,7 +29,7 @@ impl PhpExtension { || zed::npm_package_installed_version(PACKAGE_NAME)?.as_ref() != Some(&version) { zed::set_language_server_installation_status( - &config.name, + &language_server_id, &zed::LanguageServerInstallationStatus::Downloading, ); let result = zed::npm_install_package(PACKAGE_NAME, &version); @@ -63,10 +63,10 @@ impl zed::Extension for PhpExtension { fn language_server_command( &mut self, - config: zed::LanguageServerConfig, + language_server_id: &LanguageServerId, _worktree: &zed::Worktree, ) -> Result { - let server_path = self.server_script_path(config)?; + let server_path = self.server_script_path(language_server_id)?; Ok(zed::Command { command: zed::node_binary_path()?, args: vec![