mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2026-05-11 08:28:04 +02:00
lang/haskell: provide a default hls
This commit is contained in:
parent
831a8d6e0b
commit
94d11abc8f
2 changed files with 26 additions and 4 deletions
|
|
@ -53,10 +53,11 @@ in {
|
|||
|
||||
> [!NOTE]
|
||||
>
|
||||
> Since HLS is very picky about the GHC version, we do not provide
|
||||
> a default HLS. You'll have to install your own. It is recommended
|
||||
> to install `haskell-language-server` in a devShell, along with the
|
||||
> GHC version you need.
|
||||
> Since HLS is very sensitive about the GHC version, there's a very
|
||||
> high chance that the default HLS we use is not compatible with your
|
||||
> project. It is highly recommended to set
|
||||
> {option}`vim.languages.haskell.extensions.haskell-tools-nvim.setupOpts.hls.cmd`
|
||||
> to `null` and install HLS separately in a `devShell`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkLspPresetEnableOption;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.trivial) warn;
|
||||
|
||||
cfg = config.vim.lsp.presets.haskell-tools;
|
||||
lspCfg = config.vim.lsp.servers.haskell-tools;
|
||||
in {
|
||||
options.vim.lsp.presets.haskell-tools = {
|
||||
enable = mkLspPresetEnableOption "haskell-tools-nvim" "Haskell" ["haskell"];
|
||||
|
|
@ -43,6 +46,24 @@ in {
|
|||
|
||||
languages.haskell.extensions.haskell-tools-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
hls = {
|
||||
cmd =
|
||||
if (lspCfg.cmd != null)
|
||||
then
|
||||
warn ''
|
||||
config.vim.lsp.servers.haskell-tools.cmd: this option is
|
||||
ignored by haskell-tools, use
|
||||
vim.languages.haskell.extensions.haskell-tools-nvim.setupOpts.hls.cmd
|
||||
instead.
|
||||
''
|
||||
lspCfg.cmd
|
||||
else [
|
||||
"${pkgs.haskellPackages.haskell-language-server}/bin/haskell-language-server"
|
||||
"--lsp"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue