Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(haskell): Update haskell-tools.nvim to v2.0.0 #553

Merged
merged 8 commits into from
Sep 5, 2023
35 changes: 11 additions & 24 deletions lua/astrocommunity/pack/haskell/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,20 @@ return {
},
{
"mrcjkb/haskell-tools.nvim",
ft = { "haskell" },
branch = "1.x.x", -- recommended by haskell-tools
init = function() astronvim.lsp.skip_setup = utils.list_insert_unique(astronvim.lsp.skip_setup, "hls") end,
opts = {
hls = {
on_attach = function(client, bufnr) require("astronvim.utils.lsp").on_attach(client, bufnr) end,
},
},
config = function(_, opts)
local tools = require "haskell-tools"
vim.api.nvim_create_autocmd("Filetype", {
pattern = "haskell", -- autocmd to start haskell-tools
callback = function() tools.start_or_attach(opts) end,
})

vim.api.nvim_create_autocmd("LspAttach", {
pattern = "*.hs", -- autocmd to start haskell-tools
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.name == "haskell-tools.nvim" then tools.dap.discover_configurations(args.buf) end
end,
})
end,
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim", -- optional
"nvim-telescope/telescope.nvim", -- Optional
Per48edjes marked this conversation as resolved.
Show resolved Hide resolved
},
branch = "2.x.x", -- Recommended
init = function() -- Optional, see Advanced configuration
vim.g.haskell_tools = {
Uzaaft marked this conversation as resolved.
Show resolved Hide resolved
Uzaaft marked this conversation as resolved.
Show resolved Hide resolved
hls = {
Per48edjes marked this conversation as resolved.
Show resolved Hide resolved
on_attach = function(client, bufnr) require("astronvim.utils.lsp").on_attach(client, bufnr) end,
},
Per48edjes marked this conversation as resolved.
Show resolved Hide resolved
}
end,
-- load the plugin when opening one of the following file types
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
},
{
"williamboman/mason-lspconfig.nvim",
Expand Down