mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
update(nvim): switched to haskell-tools 2.x.x
This commit is contained in:
parent
76db6d493a
commit
cca10a95bf
3 changed files with 51 additions and 58 deletions
|
|
@ -181,40 +181,32 @@ require "lspconfig".metals.setup {
|
|||
}
|
||||
|
||||
-- Haskell
|
||||
-- -- `haskell-tools` needs to be in `ftplugin`.
|
||||
-- -- To simplify the setup, we create an autocmd instead.
|
||||
local setup_ht = function()
|
||||
local ht = require("haskell-tools")
|
||||
ht.start_or_attach {
|
||||
tools = {
|
||||
hover = {
|
||||
border = border,
|
||||
stylize_markdown = true,
|
||||
}
|
||||
},
|
||||
hls = {
|
||||
on_attach = function(client, bufnr)
|
||||
vim.cmd("setlocal shiftwidth=2")
|
||||
on_attach(client, bufnr)
|
||||
vim.keymap.set('n', '<space>hs', ht.hoogle.hoogle_signature,
|
||||
{ desc = "Hoogle signature", buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>he', ht.lsp.buf_eval_all, { desc = "Evaluate all", buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>hr', ht.repl.toggle, { desc = "Toggle repl" })
|
||||
end,
|
||||
default_settings = {
|
||||
haskell = {
|
||||
-- formattingProvider = "stylish-haskell"
|
||||
formattingProvider = "fourmolu"
|
||||
-- formattingProvider = "ormolu"
|
||||
}
|
||||
vim.g.haskell_tools = {
|
||||
tools = {
|
||||
hover = {
|
||||
border = border,
|
||||
stylize_markdown = true,
|
||||
}
|
||||
},
|
||||
hls = {
|
||||
on_attach = function(client, bufnr)
|
||||
local ht = require("haskell-tools")
|
||||
|
||||
vim.keymap.set('n', '<space>hs', ht.hoogle.hoogle_signature,
|
||||
{ desc = "Hoogle signature", buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>he', ht.lsp.buf_eval_all, { desc = "Evaluate all", buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>hr', ht.repl.toggle, { desc = "Toggle repl" })
|
||||
|
||||
vim.cmd("setlocal shiftwidth=2")
|
||||
on_attach(client, bufnr)
|
||||
end,
|
||||
default_settings = {
|
||||
haskell = {
|
||||
formattingProvider = "fourmolu"
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "haskell", "lhaskell", "cabal" },
|
||||
callback = setup_ht,
|
||||
})
|
||||
}
|
||||
|
||||
-- Python
|
||||
require "lspconfig".pylsp.setup {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue