From 472ac63b049a3d069644cd413d7c4ea04425ab1b Mon Sep 17 00:00:00 2001 From: Arnau Pont Vilchez <47103654+arnaupv@users.noreply.github.com> Date: Fri, 16 Jun 2023 01:30:21 +0200 Subject: [PATCH] add dap config --- lua/neotest-plenary/base.lua | 12 ++++++++++-- lua/neotest-plenary/init.lua | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lua/neotest-plenary/base.lua b/lua/neotest-plenary/base.lua index f65b43a..edb421e 100644 --- a/lua/neotest-plenary/base.lua +++ b/lua/neotest-plenary/base.lua @@ -6,9 +6,17 @@ function M.is_test_file(file_path) return vim.endswith(file_path, "_spec.lua") end -function M.get_strategy_config(strategy, python, python_script, args) +function M.get_strategy_config(strategy) local config = { - dap = nil, -- TODO: Add dap config + dap = function() + return vim.tbl_extend("keep", { + type = "nlua", + request = "attach", + name = "Neotest Debugger", + host = "127.0.0.1", + port = 8086, + }, dap_args or {}) + end, } if config[strategy] then return config[strategy]() diff --git a/lua/neotest-plenary/init.lua b/lua/neotest-plenary/init.lua index 5fbf45c..44864f1 100644 --- a/lua/neotest-plenary/init.lua +++ b/lua/neotest-plenary/init.lua @@ -120,12 +120,14 @@ function PlenaryNeotestAdapter.build_spec(args) "'" ) .. "', filter = " .. vim.inspect(filters) .. "})", }) + strategy = base.get_strategy_config(args.strategy) return { command = command, context = { results_path = results_path, file = pos.path, }, + straregy = strategy, } end