lazyvim/lua/lazyvim/plugins/extras/lang/haskell.lua
Christoph Schmidpeter cc4a3e5564
fix(lang.haskell): prevent Haskell extras from installing telescope.nvim (#6419)
## Description
Installing the Haskell extras currently installs telescope.nvim as well,
since the dependency is not marked optional. This marks it optional so
telescope.nvim is no longer pulled in automatically.

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.

Co-authored-by: Christoph Schmidpeter <christoph.schmidpeter@gmail.com>
2025-09-16 11:47:05 +02:00

95 lines
2.1 KiB
Lua

return {
recommended = function()
return LazyVim.extras.wants({
ft = { "haskell", "lhaskell" },
root = { "hie.yaml", "stack.yaml", "cabal.project", "*.cabal", "package.yaml" },
})
end,
-- 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,
},
{
"mason-org/mason.nvim",
opts = { ensure_installed = { "haskell-language-server" } },
},
{
"mfussenegger/nvim-dap",
optional = true,
dependencies = {
{
"mason-org/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", optional = true },
},
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,
},
},
},
}