From 36e953f137b53f2138f2ea4c510d7ef563810bf4 Mon Sep 17 00:00:00 2001 From: Jonas Holst Damtoft Date: Mon, 22 May 2023 20:37:47 +0200 Subject: [PATCH] fix(tests): make dap keybind optional based on nvim-dap existence --- lua/lazyvim/plugins/extras/test/core.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index 8f5843ec..a3d7da6a 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -28,11 +28,18 @@ return { keys = { { "tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, { "tR", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, - { "td", function() require("neotest").run.run({strategy = "dap"}) end, desc = "Debug Nearest" }, { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, { "to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" }, { "tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" }, { "tS", function() require("neotest").run.stop() end, desc = "Stop" }, }, }, + { + "mfussenegger/nvim-dap", + optional = true, + -- stylua: ignore + keys = { + { "td", function() require("neotest").run.run({strategy = "dap"}) end, desc = "Debug Nearest" }, + }, + }, }