How to use?
ray-x opened this issue · 3 comments
Hi, I am trying to set it up to debug my nvim lua plugins.
suppose I am trying to debug lua_test.lua. Flowed the instruction in README.md
I will open lua_test.lua in nvim instance 1 and run launch. it will echo a port (e.g. 64929) debug server is on.
In another nvim open lua_test.lua. and run lua require'dap'.countine
. I will be ask to input the debug server port.
But after I input the port. There is no message to indicate I connected to the server or not. If I run require'dap'.continue, I saw
no stopped thread, Can not move`
Is anything missed in my steps?
Hi,
All you did is correct. In order to use the debugger you can:
- Put a breakpoint using
require"dap".toggle_breapoint()
in your dap neovim instance (after openinglua_test.lua
in your case). - Launch lua-debug in the other instance
- Tell dap to continue, at the same time connect to the server.
- Run
lua_test.lua
in the server instance (where lua-debug was launched). For example using:luafile lua_test.lua
- The breakpoint should hit and freeze the other instance.
The procedure is the same for neovim plugins. Tell me if it works.
I added a message which notifies when nvim-dap connects to lua-debug. Hopefully this should make it more clear.
I followed your steps and it works now. It would be good to update the README.md as well. Thanks!