nvim: move hls to lsp.haskell module

This commit is contained in:
Primrose 2025-07-08 23:47:47 +02:00
parent 9c817814f2
commit f1cd9b036f
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
4 changed files with 52 additions and 41 deletions

View file

@ -187,47 +187,6 @@ vim.api.nvim_create_autocmd("FileType", {
group = nvim_metals_group,
})
-- Haskell
vim.g.haskell_tools = {
tools = {
log = { level = vim.log.levels.OFF },
hover = {
border = border,
stylize_markdown = true,
},
},
hls = {
on_attach = function(client, bufnr)
local ht = require("haskell-tools")
local opts = { buffer = bufnr }
map("n", "<leader>hhe", ht.lsp.buf_eval_all, opts)
map("n", "<leader>hhs", ht.hoogle.hoogle_signature, opts)
map("n", "<leader>hhr", ht.repl.toggle, opts)
vim.opt_local.shiftwidth = 2
mylsp.on_attach(client, bufnr)
end,
default_settings = {
haskell = {
checkProject = false, -- PERF: don't check the entire project on initial load
formattingProvider = "fourmolu",
plugin = {
rename = {
config = {
diff = true, -- (experimental) rename across modules
},
},
},
},
},
settings = function(project_root)
local ht = require("haskell-tools")
return ht.lsp.load_hls_settings(project_root, { settings_file_pattern = "hls.json" })
end,
},
}
----------
-- Rust --
----------