X-Git-Url: https://git.rmz.io/dotfiles.git/blobdiff_plain/71d8ed08696bb8e807b1d1518c55fd5885ed8c98..7d854464d9b1bd386b0eaf25f38ac3b96dd1fc18:/nvim/lua/plugins/lang/haskell.lua diff --git a/nvim/lua/plugins/lang/haskell.lua b/nvim/lua/plugins/lang/haskell.lua new file mode 100644 index 0000000..b1c67ff --- /dev/null +++ b/nvim/lua/plugins/lang/haskell.lua @@ -0,0 +1,89 @@ +return { + + -- Add Haskell to treesitter + { + "nvim-treesitter/nvim-treesitter", + opts = { ensure_installed = { "haskell" } }, + }, + + { + "mrcjkb/haskell-tools.nvim", + version = "^3", + ft = { "haskell", "lhaskell", "cabal", "cabalproject" }, + dependencies = { + { "nvim-telescope/telescope.nvim", optional = true }, + }, + config = function() + local ok, telescope = pcall(require, "telescope") + if ok then + telescope.load_extension("ht") + end + end, + }, + + { + "williamboman/mason.nvim", + opts = { ensure_installed = { "haskell-language-server" } }, + }, + + { + "mfussenegger/nvim-dap", + optional = true, + dependencies = { + { + "williamboman/mason.nvim", + opts = { ensure_installed = { "haskell-debug-adapter" } }, + }, + }, + }, + + { + "nvim-neotest/neotest", + optional = true, + dependencies = { + { "mrcjkb/neotest-haskell" }, + }, + opts = { + adapters = { + ["neotest-haskell"] = {}, + }, + }, + }, + + { + "mrcjkb/haskell-snippets.nvim", + dependencies = { "l3mon4d3/luasnip" }, + ft = { "haskell", "lhaskell", "cabal", "cabalproject" }, + config = function() + local haskell_snippets = require("haskell-snippets").all + require("luasnip").add_snippets("haskell", haskell_snippets, { key = "haskell" }) + end, + }, + + { + "luc-tielen/telescope_hoogle", + ft = { "haskell", "lhaskell", "cabal", "cabalproject" }, + dependencies = { + { "nvim-telescope/telescope.nvim" }, + }, + config = function() + local ok, telescope = pcall(require, "telescope") + if ok then + telescope.load_extension("hoogle") + end + end, + }, + + -- Make sure lspconfig doesn't start hls, + -- as it conflicts with haskell-tools + { + "neovim/nvim-lspconfig", + opts = { + setup = { + hls = function() + return true + end, + }, + }, + }, +}