Skip to content

Commit

Permalink
fix(pack): working haskell dap
Browse files Browse the repository at this point in the history
Co-Authored-By: Oli <[email protected]>
  • Loading branch information
2 people authored and mehalter committed May 3, 2023
1 parent 36a1c85 commit d18f633
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lua/astrocommunity/pack/haskell/haskell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,26 @@ return {
{
"mrcjkb/haskell-tools.nvim",
ft = { "haskell" },
branch = "1.x.x", -- reccomended by haskell-tools
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(_) require("haskell-tools").start_or_attach(opts) end,
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 = {
Expand Down

0 comments on commit d18f633

Please sign in to comment.