-- If you are starting out with Haskell, nvim-lspconfig.hls is probably enough for you. -- It provides the lowest common denominator of LSP support. -- This plugin is for those who would like additional features -- that are specific to Haskell tooling. -- https://github.com/MrcJkb/haskell-tools.nvim return { "haskell-tools.nvim", lazy = false, after = function() -- This is a filetype plugin that works out of the box, -- so there is no need to call a setup function or configure anything -- to get this plugin working. vim.g.haskell_tools = { tools = { hover = { enable = true, }, }, hls = { cmd = { "haskell-language-server-wrapper", "--lsp" }, enable = false, filetypes = { "haskell", "lhaskell" }, on_attach = function(client, bufnr) local ht = require("haskell-tools") local opts = { noremap = true, silent = true, buffer = bufnr } vim.keymap.set("n", "cl", vim.lsp.codelens.run, opts) vim.keymap.set("n", "hs", ht.hoogle.hoogle_signature, opts) vim.keymap.set("n", "ea", ht.lsp.buf_eval_all, opts) vim.keymap.set("n", "rr", ht.repl.toggle, opts) vim.keymap.set("n", "rf", function() ht.repl.toggle(vim.api.nvim_buf_get_name(0)) end, opts) vim.keymap.set("n", "rq", ht.repl.quit, opts) end, root_dir = 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 = { cabalFormattingProvider = "cabalfmt", formattingProvider = "fourmolu" } }, }, } end, }