feat(haskell): update haskell-tools version and add formatters + linters (#6230)

## Description

- Updates `haskell-tools` to use the recommended version in the plugin's
README
- Adds `ormolu` as a formatter
- Adds keybindings for `haskell-tools` that does not conflict with
LazyVim's defaults.

## Related Issue(s)

-
https://github.com/LazyVim/LazyVim/discussions/3325#discussioncomment-9562683:
adds `ormolu` formatter.
- https://github.com/LazyVim/LazyVim/pull/2052#issuecomment-2881764491:
@mrcjkb keeps getting bug reports because the version is still in `3`
and should be updated to `6`.

## Checklist

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

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Jose Storopoli
2025-10-20 03:17:31 -05:00
committed by GitHub
parent 8db9c75e8d
commit 82382f455a

View File

@@ -14,17 +14,40 @@ return {
{
"mrcjkb/haskell-tools.nvim",
version = "^3",
version = false,
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
dependencies = {
{ "nvim-telescope/telescope.nvim", optional = true },
keys = {
{
"<localleader>e",
"<cmd>HlsEvalAll<cr>",
ft = "haskell",
desc = "Evaluate All",
},
{
"<localleader>h",
function()
require("haskell-tools").hoogle.hoogle_signature()
end,
ft = "haskell",
desc = "Hoogle Signature",
},
{
"<localleader>r",
function()
require("haskell-tools").repl.toggle()
end,
ft = "haskell",
desc = "REPL (Package)",
},
{
"<localleader>R",
function()
require("haskell-tools").repl.toggle(vim.api.nvim_buf_get_name(0))
end,
ft = "haskell",
desc = "REPL (Buffer)",
},
},
config = function()
local ok, telescope = pcall(require, "telescope")
if ok then
telescope.load_extension("ht")
end
end,
},
{
@@ -67,17 +90,48 @@ return {
},
{
"luc-tielen/telescope_hoogle",
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
dependencies = {
{ "nvim-telescope/telescope.nvim", optional = true },
"nvim-telescope/telescope.nvim",
optional = true,
specs = {
{
"luc-tielen/telescope_hoogle",
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
opts = function()
LazyVim.on_load("telescope.nvim", function()
require("telescope").load_extension("ht")
end)
end,
keys = {
{
"<localleader>H",
"<cmd>Telescope hoogle<cr>",
ft = "haskell",
desc = "Hoogle",
},
},
},
},
},
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
haskell = { "fourmolu" },
cabal = { "cabal_fmt" },
},
},
},
{
"mfussenegger/nvim-lint",
optional = true,
opts = {
linters_by_ft = {
haskell = { "hlint" },
},
},
config = function()
local ok, telescope = pcall(require, "telescope")
if ok then
telescope.load_extension("hoogle")
end
end,
},
-- Make sure lspconfig doesn't start hls,