mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-03-10 09:27:25 +00: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",
|
"mrcjkb/haskell-tools.nvim",
|
||||||
version = "^3",
|
version = false,
|
||||||
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
||||||
dependencies = {
|
keys = {
|
||||||
{ "nvim-telescope/telescope.nvim", optional = true },
|
{
|
||||||
|
"<localleader>e",
|
||||||
|
"<cmd>HlsEvalAll<cr>",
|
||||||
|
ft = "haskell",
|
||||||
|
desc = "Evaluate All",
|
||||||
},
|
},
|
||||||
config = function()
|
{
|
||||||
local ok, telescope = pcall(require, "telescope")
|
"<localleader>h",
|
||||||
if ok then
|
function()
|
||||||
telescope.load_extension("ht")
|
require("haskell-tools").hoogle.hoogle_signature()
|
||||||
end
|
|
||||||
end,
|
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)",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -66,18 +89,49 @@ return {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
optional = true,
|
||||||
|
specs = {
|
||||||
{
|
{
|
||||||
"luc-tielen/telescope_hoogle",
|
"luc-tielen/telescope_hoogle",
|
||||||
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
|
||||||
dependencies = {
|
opts = function()
|
||||||
{ "nvim-telescope/telescope.nvim", optional = true },
|
LazyVim.on_load("telescope.nvim", function()
|
||||||
},
|
require("telescope").load_extension("ht")
|
||||||
config = function()
|
end)
|
||||||
local ok, telescope = pcall(require, "telescope")
|
|
||||||
if ok then
|
|
||||||
telescope.load_extension("hoogle")
|
|
||||||
end
|
|
||||||
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" },
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Make sure lspconfig doesn't start hls,
|
-- Make sure lspconfig doesn't start hls,
|
||||||
|
|||||||
Reference in New Issue
Block a user