nvim-dap-ui icon indicating copy to clipboard operation
nvim-dap-ui copied to clipboard

Visually indicate stack position in stack-frame window

Open zenoli opened this issue 2 years ago • 8 comments

Is it possible to indicate the current position in the stack-frame window when we navigate through the stack by showing a ">" in the list?

zenoli avatar Sep 04 '22 11:09 zenoli

I've added both a new highlight and icon to show the current frame :smile: Please try the latest master

rcarriga avatar Sep 06 '22 19:09 rcarriga

Wow, nice! Thank you so much :-) I can see the indicators when I press enter in the stack list (initially no indication of where I am in the stack is shown). Ideally I would like to navigate the call-stack using keybindings:

map("n", "[s", function() require("dap").up() end)
map("n", "]s", function() require("dap").down() end)

The naviagtion using keybindings does not update the stack window though. Also, once I pressed enter on the stack-window and try to use the keybinding afterwards, I get this error:

E5108: Error executing lua: ...e/nvim/site/pack/packer/opt/nvim-dap/lua/dap/session.lua:1441: id of current frame must be present in frames
stack traceback:
        [C]: in function 'assert'
        ...e/nvim/site/pack/packer/opt/nvim-dap/lua/dap/session.lua:1441: in function '_frame_delta'
        ...cal/share/nvim/site/pack/packer/opt/nvim-dap/lua/dap.lua:468: in function 'up'
        [string "..."]: in function <[string "..."]:0>

Let me know if you need more info to reproduce this!

Update: Ok, the issue is less severe than I initially thought: When I start the debugger and hit the first breakpoint, the stack frame window does not indicate the stack position. As soon as I do any progression ("step into/step over/run to cursor" etc") the stack indicates the position and no matter how I interact with the stack (via dap-ui or via keybindings) everything updates as expected. However, if i start the debugger, hit the first breakpoint (and the stack window not indicating the position) and then I press enter inside the stack window, the above issue occurs. I hope this helps :-) I tested it using the node2 debugger btw.

zenoli avatar Sep 06 '22 19:09 zenoli

This looks like an issue with the adapter. Can you provide the nvim-dap log?

rcarriga avatar Sep 06 '22 20:09 rcarriga

Also you may be in a hidden frame, press t in the stacks window to show them

rcarriga avatar Sep 06 '22 20:09 rcarriga

Pressing "t" does not toggle anything (it always hows "hidden" frames (i.e. frames belonging to external node related files)). How do I provide the logs? I tried setting them to DEBUG using lua require"dap".set_log_level("DEBUG") but nothing seems to show up in ~/.cache/nvim/dap.log (I deleted the file hoping it would regenerate, but it doesn't).

zenoli avatar Sep 06 '22 20:09 zenoli

Did you restart nvim after deleting the log file? It won't continue writing after being deleted in the same instance.

rcarriga avatar Sep 09 '22 07:09 rcarriga

Oh ok. So I set the log level to "TRACE", deleted the log file, started a new debugging session, clicked enter inside the stackframe window and then called require("dap").up() to trigger the error. Attached you'll find the log of the described interaction. dap.log

zenoli avatar Sep 09 '22 22:09 zenoli

AFAICT the log looks OK. Can you reproduce this without nvim-dap-ui? You can test by not calling the setup function. I'm not sure where the bug is coming from but I just want to be sure it's not nvim-dap-ui.

rcarriga avatar Sep 10 '22 13:09 rcarriga

Closing this issue as there's no activity and the original request has been resolved

rcarriga avatar Jan 08 '23 16:01 rcarriga