Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

lua: Don't cache user-installed `lua-language-server` (#10639)

Marshall Bowers5d7148bde108
diff --git a/extensions/lua/src/lua.rs b/extensions/lua/src/lua.rs
index 776c8ee3983..55347e51fb9 100644
--- a/extensions/lua/src/lua.rs
+++ b/extensions/lua/src/lua.rs
@@ -13,17 +13,16 @@ impl LuaExtension {
language_server_id: &LanguageServerId,
worktree: &zed::Worktree,
) -> Result<String> {
+ if let Some(path) = worktree.which("lua-language-server") {
+ 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("lua-language-server") {
- self.cached_binary_path = Some(path.clone());
- return Ok(path);
- }
-
zed::set_language_server_installation_status(
&language_server_id,
&zed::LanguageServerInstallationStatus::CheckingForUpdate,