Closed phenpessoa closed 3 days ago
Thanks for reporting this issue. Pushed a fix addressing this. Pls give it a try. Thx!
Thanks @ray-x !
I tested the latest commit and now I'm getting a different error:
Error executing Lua callback: ...soa/.local/share/nvim/lazy/guihua.lua/lua/guihua/gui.lua:243: on_choice: expected function, got nil
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
...soa/.local/share/nvim/lazy/guihua.lua/lua/guihua/gui.lua:243: in function 'select'
...phenpessoa/.local/share/nvim/lazy/go.nvim/lua/go/dap.lua:571: in function 'run'
...essoa/.local/share/nvim/lazy/go.nvim/lua/go/commands.lua:62: in function <...essoa/.local/share/nvim/lazy/go.nvim/lua/go/commands.lua:57>
The issue should be gone now. Could you give it another try? Thx!
@ray-x This is still erroring out for me. I get this error now:
E5108: Error executing lua: ...e/phenpessoa/.local/share/nvim/lazy/nvim-dap/lua/dap.lua:566: dap.run() must be called with a valid configuration, got nil
stack traceback:
[C]: in function 'assert'
...e/phenpessoa/.local/share/nvim/lazy/nvim-dap/lua/dap.lua:566: in function 'run'
...phenpessoa/.local/share/nvim/lazy/go.nvim/lua/go/dap.lua:572: in function 'on_confirm'
...l/share/nvim/lazy/guihua.lua/lua/guihua/listviewctrl.lua:485: in function 'on_confirm'
...l/share/nvim/lazy/guihua.lua/lua/guihua/listviewctrl.lua:110: in function <...l/share/nvim/lazy/guihua.lua/lua/guihua/listviewctrl.lua:110>
But I think I found the issue. If I change these lines (./lua/go/dap.lua 571-573
):
vim.ui.select(launch_names, { prompt = 'which you would like to debug' }, function(index)
dap.run(dap.configurations.go[index])
end)
To this:
vim.ui.select(launch_names, { prompt = 'which you would like to debug' }, function(name)
local index = 0
for i, c in ipairs(dap.configurations.go) do
if c.name == name then
index = i
break
end
end
dap.run(dap.configurations.go[index])
end)
The issue is fixed and I'm able to debug. However I'm not sure if this is the best solution.
Thanks for the update. the select should accept idx as parameter. there is something wrong with guihua implementation. Please update both go.nvim and guihua.lua. It should work without your hack.
Thanks! Can confirm that with the latest version of guihua and go.nvim the error is gone. I'm able to debug fine now! :tada:
Cheers!
I'm not sure if I'm doing something wrongly here, but I'm unable to debug my code if
launch.json
is present. If there is nolaunch.json
file, then I can debug just fine.I place my cursor on my main function, and simply run
:GoDebug
. It works. However, if I run:GoDbgConfig
, which creates thelaunch.json
file and then try to run:GoDebug
again on the main function, I get the following error:I didn't change anything in the
launch.json
file. I'm testing it with just how it comes from:GoDbgConfig
.If I delete the
launch.json
file I'm able to debug my code again. Any help will be greatly appreciated, thanks.Neovim version:
My config:
I'm running commit
3ea80d7
.