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:
Marshall Bowers
2024-03-29 18:03:38 -04:00
committed by GitHub
parent 30193647f3
commit b0fb02e4be
16 changed files with 69 additions and 81 deletions
+27
View File
@@ -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);