From dd5c7d382f7b4f5f3b7feb311a42904a61bdbab7 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Fri, 16 Jun 2023 17:49:47 -0400 Subject: [PATCH] haskell-debugger --- .../config/lazyvim/lua/config/autocmds.lua | 24 +++++++++++++++++++ homeConfig/modules/neovim/config/servers.nix | 7 ++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/homeConfig/modules/neovim/config/lazyvim/lua/config/autocmds.lua b/homeConfig/modules/neovim/config/lazyvim/lua/config/autocmds.lua index 776ea0f..8f73b24 100644 --- a/homeConfig/modules/neovim/config/lazyvim/lua/config/autocmds.lua +++ b/homeConfig/modules/neovim/config/lazyvim/lua/config/autocmds.lua @@ -103,3 +103,27 @@ cmp.setup({ [""] = cmp.mapping.select_prev_item(), }, }) + +local dap = require("dap") +dap.adapters.haskell = { + type = "executable", + command = "haskell-debug-adapter", + args = { "--hackage-version=0.0.33.0" }, +} +dap.configurations.haskell = { + { + type = "haskell", + request = "launch", + name = "Debug", + workspace = "${workspaceFolder}", + startup = "${file}", + stopOnEntry = true, + logFile = vim.fn.stdpath("data") .. "/haskell-dap.log", + logLevel = "WARNING", + ghciEnv = vim.empty_dict(), + ghciPrompt = "λ: ", + -- Adjust the prompt to the prompt you see when you invoke the ghci command below + ghciInitialPrompt = "λ: ", + ghciCmd = "ghci --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show", + }, +} diff --git a/homeConfig/modules/neovim/config/servers.nix b/homeConfig/modules/neovim/config/servers.nix index ad0babc..40ee7e5 100644 --- a/homeConfig/modules/neovim/config/servers.nix +++ b/homeConfig/modules/neovim/config/servers.nix @@ -19,6 +19,9 @@ let pyright purescript-language-server ]; - + + debug = with pkgs; [ + haskellPackages.haskell-debug-adapter + ]; in - lsp ++ lsp' + lsp ++ lsp' ++ debug