mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-12-25 12:14:19 +01:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user