erlang_ls.rs

 1use zed_extension_api::{self as zed, LanguageServerId, Result};
 2
 3pub struct ErlangLs;
 4
 5impl ErlangLs {
 6    pub const LANGUAGE_SERVER_ID: &'static str = "erlang-ls";
 7
 8    pub fn new() -> Self {
 9        Self
10    }
11
12    pub fn language_server_binary_path(
13        &mut self,
14        _language_server_id: &LanguageServerId,
15        worktree: &zed::Worktree,
16    ) -> Result<String> {
17        worktree
18            .which("erlang_ls")
19            .ok_or_else(|| "erlang_ls must be installed and available on your $PATH".to_string())
20    }
21}