Extract Haskell support into an extension (#9814)
This PR extracts Haskell support into an extension and removes the built-in Haskell support from Zed. I tested out the extension locally in a Nix shell using `nix-shell -p ghc haskell-language-server` to confirm the language server still operated as expected: <img width="341" alt="Screenshot 2024-03-26 at 11 26 26 AM" src="https://github.com/zed-industries/zed/assets/1486634/df16fd38-4046-4a45-ac9f-c2b85bffe5c0"> Release Notes: - Removed built-in support for Haskell, in favor of making it available as an extension. The Haskell extension will be suggested for download when you open a `.hs` file.
This commit is contained in:
parent
9d4c6c60fb
commit
1d6792b17d
15 changed files with 72 additions and 67 deletions
27
extensions/haskell/src/haskell.rs
Normal file
27
extensions/haskell/src/haskell.rs
Normal file
|
@ -0,0 +1,27 @@
|
|||
use zed_extension_api::{self as zed, Result};
|
||||
|
||||
struct HaskellExtension;
|
||||
|
||||
impl zed::Extension for HaskellExtension {
|
||||
fn new() -> Self {
|
||||
Self
|
||||
}
|
||||
|
||||
fn language_server_command(
|
||||
&mut self,
|
||||
_config: zed::LanguageServerConfig,
|
||||
worktree: &zed::Worktree,
|
||||
) -> Result<zed::Command> {
|
||||
let path = worktree
|
||||
.which("haskell-language-server-wrapper")
|
||||
.ok_or_else(|| "hls must be installed via ghcup".to_string())?;
|
||||
|
||||
Ok(zed::Command {
|
||||
command: path,
|
||||
args: vec!["lsp".to_string()],
|
||||
env: Default::default(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
zed::register_extension!(HaskellExtension);
|
Loading…
Add table
Add a link
Reference in a new issue