Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Making DAP available in the adapter #8

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions lua/neotest-plenary/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Author

@arnaupv arnaupv Jun 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both, host and port should be part of the configuration instead of being hardcoded. Ideally, they should be provided by the following dependency: one-small-step-for-vimkind

port = 8086,
}, dap_args or {})
end,
}
if config[strategy] then
return config[strategy]()
Expand Down
2 changes: 2 additions & 0 deletions lua/neotest-plenary/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down