41 lines
1.2 KiB
Lua
41 lines
1.2 KiB
Lua
return {
|
|
"mrcjkb/haskell-tools.nvim",
|
|
ft = { "haskell", "lhaskell", "cabal" },
|
|
dependencies = { "L3MON4D3/LuaSnip", "nvim-treesitter/nvim-treesitter" },
|
|
opts = {
|
|
|
|
hls = {
|
|
cmd = { "haskell-language-server-wrapper", "--lsp" },
|
|
settings = {
|
|
haskell = {
|
|
formattingProvider = "fourmolu",
|
|
-- wir nutzen das interne Plugin, kein externes Binary nötig:
|
|
plugin = { fourmolu = { config = { external = false } } },
|
|
|
|
-- .cabal-Formatting komplett deaktivieren (sonst verlangt HLS cabal-fmt)
|
|
cabalFormattingProvider = "none",
|
|
},
|
|
},
|
|
},
|
|
-- optional: Safety im on_attach
|
|
on_attach = function(client, bufnr)
|
|
if vim.bo[bufnr].filetype == "cabal" then
|
|
client.server_capabilities.documentFormattingProvider = false
|
|
end
|
|
end,
|
|
-- falls Lazy mal falsch cached: lade LuaSnip aktiv vorher
|
|
init = function()
|
|
if not package.loaded["luasnip"] then
|
|
local ok, lazy = pcall(require, "lazy")
|
|
if ok then
|
|
lazy.load({ plugins = { "LuaSnip" } })
|
|
end
|
|
end
|
|
end,
|
|
-- lade nur, wenn require("luasnip") wirklich klappt
|
|
cond = function()
|
|
return package.loaded["luasnip"] or pcall(require, "luasnip")
|
|
end,
|
|
},
|
|
}
|