diff --git a/extensions/terraform/src/terraform.rs b/extensions/terraform/src/terraform.rs index 8dfabce23e..e090395720 100644 --- a/extensions/terraform/src/terraform.rs +++ b/extensions/terraform/src/terraform.rs @@ -12,17 +12,16 @@ impl TerraformExtension { language_server_id: &LanguageServerId, worktree: &zed::Worktree, ) -> Result { + if let Some(path) = worktree.which("terraform-ls") { + return Ok(path); + } + if let Some(path) = &self.cached_binary_path { if fs::metadata(path).map_or(false, |stat| stat.is_file()) { return Ok(path.clone()); } } - if let Some(path) = worktree.which("terraform-ls") { - self.cached_binary_path = Some(path.clone()); - return Ok(path); - } - zed::set_language_server_installation_status( &language_server_id, &zed::LanguageServerInstallationStatus::CheckingForUpdate,