-
Notifications
You must be signed in to change notification settings - Fork 10
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
[BUG] Attaching to running instance doesn't work (fzf-lua) #45
Comments
Thank you for opening an issue. At first glance, I don't see what is wrong. The steps (which are nicely explained) seem to be correct. Could you try launching the server with logging enabled. This would translate to changing the following line in your config. keys = {
{ "<F5>", [[:lua require"osv".launch({port = 8086, log=true})<CR>]], desc = "Launch OSV", noremap = true },
}, This should output a log file within the nvim-data folder which can be found by running |
After I invoked with logs and terminated debuggee I get this
|
I still cannot pinpoint what is going on. I should have asked ealier but could you log nvim-dap as well? Maybe something to try would be to change the port. It may be a port blocking issue although I doubt it. |
It would be awesome if you could log |
MacOS Sonoma 14.5 NVIM v0.10.0 For some reason I didn't get any dap.log after setting the log to trace.
|
I will get back later but make sure to check |
you are right my bad here is the file
|
Would running this help before running :lua require"osv".stop = function() end Then execute |
I just had a look in the config you linked. From the look of it, there is a substantial amount of plugin installed. I wouldn't be suprised if something is interacting together with Another possibility is the OS which I cannot test right now. |
this didn't work |
I will check with vanilla lazyvim starter then |
Ok I checked. It wasn't lazyvim, not lazyvim-starter. But I found the issue the issue is this call https://github.com/kapral18/dotfiles/blob/ad539b7b57222293fdcae58fa2dde498789a34dd/home/dot_config/exact_nvim/exact_lua/exact_plugins/fzf.lua#L339 and I mean just the require, not the references, because I commented all them out and it hangs precisely on this require call. Something apparently happens inside fzf-lua actions that causes the osv to hang. Not sure but maybe @ibhagwan has an idea? |
Interesting. It was not known that The problem is that probably someone needs to know the inner workings of both I don't follow how you pinpointed the error but it would be nice to pinpoint it further. So the require means it's inside this file actions.lua of fzf-lua when it's first executed. Which could be inside the utils.lua which is in turn required, possibly. |
The only thing I can think of is the overload of the It is possible that since you’re loading You can try changing the actions require to |
hey @ibhagwan you absolutely hit the nail on the head, I can confirm that with |
Great! I think I might add a global so this doesn’t happen even in this extreme edge cases. |
## Description <!-- Describe the big picture of your changes to communicate to the maintainers why we should accept this pull request. --> Reference: jbyuki/one-small-step-for-vimkind#45 (comment) Fix nlua debug adapter not responding, which for some reason because of `fzf-lua`. ## Related Issue(s) <!-- If this PR fixes any issues, please link to the issue here. - Fixes #<issue_number> --> ## Screenshots <!-- Add screenshots of the changes if applicable. --> No screenshot instead I'm providing how to reproduce with assumption `dap.nlua` extra is enabled. Steps: 1. Launch the nlua `:lua require'osv'.launch({port=8086})` 2. Attach from any neovim instance to the debugger 1. Run the debugger - Can do `<leader>dc`; or - Can do `:lua require'dap'.continue()` 2. Choose `Attach to running Neovim instance (port = 8086)` 3. Prior to this changes, debugger will got timeout like the following ```text Debug adapter didn't respond. Either the adapter is slow (then wait and ignore this) or there is a problem with your adapter or `nlua` configuration. Check the logs for errors (:help dap.set_log_level) ``` ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
## Description <!-- Describe the big picture of your changes to communicate to the maintainers why we should accept this pull request. --> Reference: jbyuki/one-small-step-for-vimkind#45 (comment) Fix nlua debug adapter not responding, which for some reason because of `fzf-lua`. ## Related Issue(s) <!-- If this PR fixes any issues, please link to the issue here. - Fixes #<issue_number> --> ## Screenshots <!-- Add screenshots of the changes if applicable. --> No screenshot instead I'm providing how to reproduce with assumption `dap.nlua` extra is enabled. Steps: 1. Launch the nlua `:lua require'osv'.launch({port=8086})` 2. Attach from any neovim instance to the debugger 1. Run the debugger - Can do `<leader>dc`; or - Can do `:lua require'dap'.continue()` 2. Choose `Attach to running Neovim instance (port = 8086)` 3. Prior to this changes, debugger will got timeout like the following ```text Debug adapter didn't respond. Either the adapter is slow (then wait and ignore this) or there is a problem with your adapter or `nlua` configuration. Check the logs for errors (:help dap.set_log_level) ``` ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
I am using LazyVim which uses this setup https://github.com/LazyVim/LazyVim/blob/ad22adab7d446018875de2dc96168295cad9298e/lua/lazyvim/plugins/extras/dap/nlua.lua#L31
Here is my config on top:
https://github.com/kapral18/dotfiles/blob/ad539b7b57222293fdcae58fa2dde498789a34dd/home/dot_config/exact_nvim/exact_lua/exact_plugins/osv.lua
Initially I spotted the issue when trying to debug plugins inside lazy.nvim plugin folder, but to showcase the gist of it a simplified example will do as well.
main.lua
:I run
F5
from my config and seeServer started on port 8086
.I open a second nvim instance with the same file, and set breakpoint on line 3 (with
print(2)
).Call nvim-dap continue and attach to 8086

I see the message "Running: Attach to running Neovim instance" but couple of seconds later got a message about debug adapter not responding

I switch to debugee instance and run the file to make sure keymap is registered with
:luafile %
I try the keymap and only see printed number in debuggee. Debugger doesn't respond.
I exit debuggee instance and the debugger suddenly pops up the dap widget UI

But at no point the breakpoint is caught.
The text was updated successfully, but these errors were encountered: