Open eerison opened 4 months ago
maybe it is not working because I am using: mason-nvim-dap ....
@eerison could you start with some minimal example? I especially mean no additional plugins and no containerized environment to elminiate external dependencies.
I updated https://github.com/przepompownia/neotest-phpunit-example to ensure if it works with recent dependencies on the provided example and then fixed it to work on some real project too. I used unit tests from Phpactor and they work. You can try it too at the start or provide other minimal repro.
Hey @przepompownia I guess it was related with other dependency, I guess it was on https://github.com/williamboman/mason-lspconfig.nvim
after I update it, it is not losting the buffer file as you described here: https://github.com/olimorris/neotest-phpunit?tab=readme-ov-file#debugging-with-dap-strategy
it is working, but I use like ...
add a break point and execute DAP debugger, after this I execute the tests and it works as expect.
I am not using d
from summary ... I guess to make this work I need to set dap on neotest.
I guess it should work out the box: https://github.com/nvim-neotest/neotest?tab=readme-ov-file#strategies
in theory when run via summary d
it executes require("neotest").run.run({strategy = "dap"})
...
in theory you could get the dap from there, don't you?
I am getting this error message:
 Warn 16:18:52 notify.warn Neotest neotest-phpunit: ...e/nvim/lazy/neotest-phpunit/lua/neotest-phpunit/init.lua:16: dap: expected not empty table, got nil. Info: Configure
dap
field (like in dap.configurations.php) before using this strategy
I tried like this: dap = require("dap").configurations[1],
(https://github.com/eerison/lazyvim/blob/main/lua/plugins/php.lua#L85)
But it didn't work :'(
I don't know how to make it work :(
Look at your configurations. I'm not sure if it's saved directly into dap.configurations
. Notice that it's a list of tables. Try to add php
key, i.e.
config.configurations = {
php = {
type = ...
You can try also declare dap.configurations
directly like in README here (with your settings inside).
What lua vim.print(require'dap'.configurations.php)
shows you?
Does your DAP configuration work outside neotest?
While debugging you can also assign duplicated adapter configuration table directly under dap
key of neotest-phpunit
configuration.
lua vim.print(require'dap'.configurations.php)
{ {
name = "Listen for Xdebug",
pathMappings = {
["/app"] = "${workspaceFolder}"
},
port = 9003,
request = "launch",
type = "php"
}, {
name = "PHP: Listen for Xdebug",
port = 9000,
request = "launch",
type = "php"
} }
after get last updates the DAP is not working anymore :/
I tried to do this
But it is not working :/
it is my config: https://github.com/eerison/lazyvim/blob/main/lua/plugins/php.lua#L34
do you have any example to set this with lazyvim?