From b1e9679621cd66becfda6f7e1870a85cfdd830df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Fri, 1 Dec 2023 01:01:28 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(nvim):=20added=20haskell=20ext?= =?UTF-8?q?ra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nvim/lua/plugins/extras/lang/haskell.lua | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .config/nvim/lua/plugins/extras/lang/haskell.lua diff --git a/.config/nvim/lua/plugins/extras/lang/haskell.lua b/.config/nvim/lua/plugins/extras/lang/haskell.lua new file mode 100644 index 00000000..8e1a07b7 --- /dev/null +++ b/.config/nvim/lua/plugins/extras/lang/haskell.lua @@ -0,0 +1,89 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "haskell" }) + end + end, + }, + { + "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 = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "haskell-language-server" }) + end, + }, + { + "mfussenegger/nvim-dap", + optional = true, + dependencies = { + { + "williamboman/mason.nvim", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "haskell-debug-adapter" }) + end, + }, + }, + }, + { + "nvim-neotest/neotest", + optional = true, + dependencies = { + { "mrcjkb/neotest-haskell" }, + }, + opts = { + adapters = { + ["neotest-haskell"] = {}, + }, + }, + }, + { + "mrcjkb/haskell-snippets.nvim", + dependencies = { "L3MON4D3/LuaSnip" }, + 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, + }, + }, + }, +}