Skip to content

Commit

Permalink
feat(pack): enable automatic install of haskell dap (#177)
Browse files Browse the repository at this point in the history
* feat(pack): enable automatic install of haskell dap

Author: Samuel Cobb <68509699+sjcobb2022@users.noreply.github.com>
Co-Authored-By: Olivier Wittek <57495944+owittek@users.noreply.github.com>

* fix(pack): working haskell dap

Co-Authored-By: Oli <57495944+owittek@users.noreply.github.com>

* feat: haskell-debug-adapter (#1)

* fix: working haskell debug adapter
---------

Co-authored-by: Oli <57495944+owittek@users.noreply.github.com>

---------

Co-authored-by: Samuel Cobb <68509699+sjcobb2022@users.noreply.github.com>
  • Loading branch information
owittek and sjcobb2022 authored May 4, 2023
1 parent d4e7d39 commit af30b33
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions lua/astrocommunity/pack/haskell/haskell.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,39 @@ 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 = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim", -- optional
-- TODO: Need haskell to be pulled into mason-nvim-dap (haskell hopefully coming soon)
-- {
-- "jay-babu/mason-nvim-dap.nvim",
-- opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "haskell") end,
-- },
},
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "hls") end,
},
{
"jay-babu/mason-nvim-dap.nvim",
opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "haskell") end,
},
}

0 comments on commit af30b33

Please sign in to comment.