add(nvim): haskell-tools

This commit is contained in:
Léana 江 2023-07-09 09:40:54 +08:00 committed by Léana 江
parent 555b878b7e
commit 33f5ad52d8
2 changed files with 18 additions and 8 deletions

View file

@ -179,17 +179,22 @@ require "lspconfig".metals.setup {
on_attach = on_attach,
capabilities = capabilities,
}
-- Haskell
require "lspconfig".hls.setup {
on_attach = on_attach,
capabilities = capabilities,
settings = {
haskell = {
cabalFormattingProvider = "cabalfmt",
formattingProvider = "ormolu"
-- `haskell-tools` needs to be in `ftplugin`.
-- To simplify the setup, we create an autocmd instead.
local setup_ht = function()
require("haskell-tools").start_or_attach {
hls = {
on_attach = on_attach
}
}
}
end
vim.api.nvim_create_autocmd("FileType", {
pattern = { "cabal", "haskell", "lhaskell" },
callback = setup_ht
})
-- Python
require "lspconfig".pylsp.setup {
on_attach = on_attach,