This commit is contained in:
Siggsy 2025-11-08 06:02:04 +00:00 committed by GitHub
commit 0cf2cb663c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 23 deletions

View file

@ -584,3 +584,10 @@
[mellow.nvim]: https://github.com/mellow-theme/mellow.nvim [mellow.nvim]: https://github.com/mellow-theme/mellow.nvim
- Add [mellow.nvim] plugin for vim and lualine theme support - Add [mellow.nvim] plugin for vim and lualine theme support
[Siggsy](https://github.com/siggsy):
- Fix `vim.languages.haskell.lsp` using `lspconfig` options instead of
`haskell-tools.nvim` options.
- Fix default language server `cmd` by replacing `haskell-language-server-wrapper` with `haskell-language-server`

View file

@ -12,18 +12,18 @@
inherit (lib.nvim.types) mkGrammarOption; inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.dag) entryAfter; inherit (lib.nvim.dag) entryAfter;
inherit (lib.nvim.lua) toLuaObject; inherit (lib.nvim.lua) toLuaObject;
inherit (lib.nvim.attrsets) mapListToAttrs;
inherit (lib.meta) getExe'; inherit (lib.meta) getExe';
inherit (lib.generators) mkLuaInline; inherit (lib.generators) mkLuaInline;
inherit (pkgs) haskellPackages; inherit (pkgs) haskellPackages;
cfg = config.vim.languages.haskell; cfg = config.vim.languages.haskell;
defaultServers = ["hls"]; defaultServers = ["haskell-tools"];
servers = { servers = {
hls = { haskell-tools = {
enable = false; enable = true;
cmd = [(getExe' pkgs.haskellPackages.haskell-language-server "haskell-language-server-wrapper") "--lsp"]; cmd = [(getExe' pkgs.haskellPackages.haskell-language-server "haskell-language-server") "--lsp"];
filetypes = ["haskell" "lhaskell"];
on_attach = on_attach =
mkLuaInline mkLuaInline
/* /*
@ -43,23 +43,6 @@
vim.keymap.set('n', '<localleader>rq', ht.repl.quit, opts) vim.keymap.set('n', '<localleader>rq', ht.repl.quit, opts)
end end
''; '';
root_dir =
mkLuaInline
/*
lua
*/
''
function(bufnr, on_dir)
local fname = vim.api.nvim_buf_get_name(bufnr)
on_dir(util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project', '*.cabal', 'package.yaml')(fname))
end
'';
settings = {
haskell = {
formattingProvider = "ormolu";
cabalFormattingProvider = "cabalfmt";
};
};
}; };
}; };
in { in {
@ -98,6 +81,15 @@ in {
}; };
}) })
(mkIf cfg.lsp.enable {
vim.lsp.servers =
mapListToAttrs (n: {
name = n;
value = servers.${n};
})
cfg.lsp.servers;
})
(mkIf (cfg.dap.enable || cfg.lsp.enable) { (mkIf (cfg.dap.enable || cfg.lsp.enable) {
vim = { vim = {
startPlugins = ["haskell-tools-nvim"]; startPlugins = ["haskell-tools-nvim"];
@ -113,7 +105,6 @@ in {
enable = true, enable = true,
}, },
}, },
hls = ${toLuaObject servers.hls},
''} ''}
${optionalString cfg.dap.enable '' ${optionalString cfg.dap.enable ''
dap = { dap = {