Extract Erlang support into an extension (#9974)
This PR extracts Erlang support into an extension and removes the built-in Erlang support from Zed. Tested using a Nix shell: ``` nix-shell -p erlang-ls ``` Release Notes: - Removed built-in support for Erlang, in favor of making it available as an extension. The Erlang extension will be suggested for download when you open a `.erl` or `.hrl` file.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
use zed_extension_api::{self as zed, Result};
|
||||
|
||||
struct ErlangExtension;
|
||||
|
||||
impl zed::Extension for ErlangExtension {
|
||||
fn new() -> Self {
|
||||
Self
|
||||
}
|
||||
|
||||
fn language_server_command(
|
||||
&mut self,
|
||||
_config: zed::LanguageServerConfig,
|
||||
worktree: &zed::Worktree,
|
||||
) -> Result<zed::Command> {
|
||||
let path = worktree
|
||||
.which("erlang_ls")
|
||||
.ok_or_else(|| "erlang_ls must be installed and available on your $PATH".to_string())?;
|
||||
|
||||
Ok(zed::Command {
|
||||
command: path,
|
||||
args: Vec::new(),
|
||||
env: Default::default(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
zed::register_extension!(ErlangExtension);
|
||||
Reference in New Issue
Block a user