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