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.

elixir: Check for next-ls and lexical in path first (#11318)

Andrei Zvonimir Crnkovićb3d969ef3c5d
diff --git a/extensions/elixir/src/language_servers/lexical.rs b/extensions/elixir/src/language_servers/lexical.rs
index b15984498fa..cbab9f07c21 100644
--- a/extensions/elixir/src/language_servers/lexical.rs
+++ b/extensions/elixir/src/language_servers/lexical.rs
@@ -20,8 +20,12 @@ impl Lexical {
pub fn language_server_binary_path(
&mut self,
language_server_id: &LanguageServerId,
- _worktree: &zed::Worktree,
+ worktree: &zed::Worktree,
) -> Result<String> {
+ if let Some(path) = worktree.which("lexical") {
+ 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());
diff --git a/extensions/elixir/src/language_servers/next_ls.rs b/extensions/elixir/src/language_servers/next_ls.rs
index 14c216f312b..c63d61a713b 100644
--- a/extensions/elixir/src/language_servers/next_ls.rs
+++ b/extensions/elixir/src/language_servers/next_ls.rs
@@ -20,8 +20,12 @@ impl NextLs {
pub fn language_server_binary_path(
&mut self,
language_server_id: &LanguageServerId,
- _worktree: &zed::Worktree,
+ worktree: &zed::Worktree,
) -> Result<String> {
+ if let Some(path) = worktree.which("next-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());