From 1ba0bf925b821958f781f4585626fb365e155bd7 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Tue, 16 Apr 2024 13:12:08 -0400 Subject: [PATCH] clojure: Don't cache user-installed `clojure-lsp` (#10636) This PR updates the Clojure extension to not cache the binary when it is using the one on the $PATH. Release Notes: - N/A --- extensions/clojure/src/clojure.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/extensions/clojure/src/clojure.rs b/extensions/clojure/src/clojure.rs index 93eb69227bfc1f6eacff1a3c1931ddc556545311..29dca03f4061ec141a724ccfd4530aefb61d44cb 100644 --- a/extensions/clojure/src/clojure.rs +++ b/extensions/clojure/src/clojure.rs @@ -11,17 +11,16 @@ impl ClojureExtension { config: zed::LanguageServerConfig, worktree: &zed::Worktree, ) -> Result { + if let Some(path) = worktree.which("clojure-lsp") { + 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("clojure-lsp") { - self.cached_binary_path = Some(path.clone()); - return Ok(path); - } - zed::set_language_server_installation_status( &config.name, &zed::LanguageServerInstallationStatus::CheckingForUpdate,