Files
oak-gpui/extensions/erlang/src/erlang.rs
T
Marshall Bowers b0fb02e4be 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.
2024-03-29 18:03:38 -04:00

28 lines
662 B
Rust

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);