jbyuki / one-small-step-for-vimkind

Debug adapter for Neovim plugins
MIT License
409 stars 11 forks source link

How to use? #1

Closed ray-x closed 3 years ago

ray-x commented 3 years ago

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 sawno stopped thread, Can not move`

Is anything missed in my steps?

jbyuki commented 3 years ago

Hi,

All you did is correct. In order to use the debugger you can:

  1. Put a breakpoint using require"dap".toggle_breapoint() in your dap neovim instance (after opening lua_test.lua in your case).
  2. Launch lua-debug in the other instance
  3. Tell dap to continue, at the same time connect to the server.
  4. Run lua_test.lua in the server instance (where lua-debug was launched). For example using :luafile lua_test.lua
  5. The breakpoint should hit and freeze the other instance.

The procedure is the same for neovim plugins. Tell me if it works.

jbyuki commented 3 years ago

I added a message which notifies when nvim-dap connects to lua-debug. Hopefully this should make it more clear.

ray-x commented 3 years ago

I followed your steps and it works now. It would be good to update the README.md as well. Thanks!