From d18f633ee53e960668d926b39f8c9e445a693654 Mon Sep 17 00:00:00 2001 From: Samuel Cobb <68509699+sjcobb2022@users.noreply.github.com> Date: Tue, 2 May 2023 13:00:53 +0200 Subject: [PATCH] fix(pack): working haskell dap Co-Authored-By: Oli <57495944+owittek@users.noreply.github.com> --- lua/astrocommunity/pack/haskell/haskell.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lua/astrocommunity/pack/haskell/haskell.lua b/lua/astrocommunity/pack/haskell/haskell.lua index d8d9b8025..047fddb86 100644 --- a/lua/astrocommunity/pack/haskell/haskell.lua +++ b/lua/astrocommunity/pack/haskell/haskell.lua @@ -13,7 +13,7 @@ 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 = { @@ -21,9 +21,18 @@ return { }, }, 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 = {