Skip to content

[BUG] Attaching to running instance doesn't work (fzf-lua) #45

Closed
@kapral18

Description

@kapral18

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.

  1. I create main.lua:
local function test()
	print(1)
	print(2)
	print(3)
	print(4)
	print(5)
	print(6)
end

vim.keymap.set("n", "<Space>0", test, { buffer = true })
  1. I run F5 from my config and see Server started on port 8086.

  2. I open a second nvim instance with the same file, and set breakpoint on line 3 (with print(2)).

  3. Call nvim-dap continue and attach to 8086
    image

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

  5. I switch to debugee instance and run the file to make sure keymap is registered with :luafile %

  6. I try the keymap and only see printed number in debuggee. Debugger doesn't respond.

  7. I exit debuggee instance and the debugger suddenly pops up the dap widget UI
    image

But at no point the breakpoint is caught.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions