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

Debug via summary is not working #25

Open
eerison opened this issue Apr 24, 2024 · 9 comments
Open

Debug via summary is not working #25

eerison opened this issue Apr 24, 2024 · 9 comments

Comments

@eerison
Copy link

eerison commented Apr 24, 2024

after get last updates the DAP is not working anymore :/

I tried to do this

dap = dap.configurations.php[1],

...

dap.defaults.fallback.switchbuf = "useopen"

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?

@eerison
Copy link
Author

eerison commented Apr 24, 2024

maybe it is not working because I am using: mason-nvim-dap ....

@przepompownia
Copy link
Contributor

przepompownia commented Apr 25, 2024

@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.

@eerison
Copy link
Author

eerison commented Apr 26, 2024

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.

@eerison
Copy link
Author

eerison commented Apr 26, 2024

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?

eerison pushed a commit to eerison/lazyvim that referenced this issue Apr 26, 2024
This commit contains dap configurations for neotest-phpunit, but it is not working properly yet
Maybe it is missing some special configuration for lazyvim

Issue on neotest-phpunit: olimorris/neotest-phpunit#25
eerison added a commit to eerison/lazyvim that referenced this issue Apr 26, 2024
This commit contains dap configurations for neotest-phpunit, but it is not working properly yet
Maybe it is missing some special configuration for lazyvim

Issue on neotest-phpunit: olimorris/neotest-phpunit#25
@eerison
Copy link
Author

eerison commented Apr 26, 2024

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 :(

@eerison eerison changed the title DAP is not working Debug via summary is not working Apr 26, 2024
@przepompownia
Copy link
Contributor

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).

@przepompownia
Copy link
Contributor

przepompownia commented Apr 26, 2024

What lua vim.print(require'dap'.configurations.php) shows you?

@przepompownia
Copy link
Contributor

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.

@eerison
Copy link
Author

eerison commented Jul 3, 2024

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"
  } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants