Skip to content

Conversation

@igorlfs
Copy link
Owner

@igorlfs igorlfs commented May 2, 2025

Closes #33

image


TODO

  • Docs

Bugs

  • A race condition with the JS debug adapter causes variables to not be evaluated properly when stepping

Same as #31, fixed by using scopes instead of event_stopped

  • It's janky AF. May resolve that in a follow-up PR.

It's very that's caused by calling watches.show() too often.
Workaround: 98363cf

@igorlfs igorlfs mentioned this pull request May 1, 2025
6 tasks
@igorlfs igorlfs force-pushed the feat/expand-variables branch from 203906f to 9c233df Compare May 4, 2025 14:02
igorlfs added 4 commits May 4, 2025 11:14
By removing the `evaluate` listener, we redraw less often. Next step is
to get rid of the `variables` listener
@igorlfs igorlfs marked this pull request as ready for review May 4, 2025 15:56
@RizaHKhan

This comment was marked as resolved.

@igorlfs
Copy link
Owner Author

igorlfs commented May 4, 2025

Error executing vim.schedule lua callback: ...re/nvim/lazy/nvim-dap-view/lua/dap-view/watches/view.lua:123: attempt to index field 'type' (a nil value)

Thanks! That should be fixed in the latest commit!

Your plugin removes some really useful functionality like 'hover'. For example:

What are you referring to? What did you do and what do you expect to happen with the hover?

@RizaHKhan
Copy link

Dude that is hilarious, I thought my bug was wrong so I deleted it, you fixed it so fast. Thanks!!

@RizaHKhan

This comment was marked as resolved.

@RizaHKhan
Copy link

RizaHKhan commented May 4, 2025

Re: Hover

In the original Dap UI plugin, you can hover on a variable to see its value.

https://github.com/rcarriga/nvim-dap-ui

image

For context, I'm using AstroNvim with the community plugins (so behind the scenes I'm thinking they remove some functionality).

@igorlfs
Copy link
Owner Author

igorlfs commented May 4, 2025

(We already talked about this), but on Xdebug I can't watch a variable:

Can you try using set iskeyword+=$ before calling DapViewWatch?

In the original Dap UI plugin, you can hover on a variable to see its value.

Fortunately, nvim-dap offers a built-in hover! You can give a try with:

require("dap.ui.widgets").hover()

@RizaHKhan
Copy link

Can you try using set iskeyword+=$ before calling DapViewWatch?

This did the trick

@RizaHKhan
Copy link

RizaHKhan commented May 4, 2025

I'm approving the PR (not worth much, I am not a lua developer), but going take this for a spin in my day job and point out things I find in the Issues tab

@RizaHKhan
Copy link

RizaHKhan commented May 5, 2025

@igorlfs

                     Error executing vim.schedule lua callback: ...re/nvim/lazy/nvim-dap-view/lua/dap-view/watches/view.lua:92: Invalid window id: 1226
stack traceback:
	[C]: in function 'nvim_win_get_cursor'
	...re/nvim/lazy/nvim-dap-view/lua/dap-view/watches/view.lua:92: in function 'show'
	...nvim/lazy/nvim-dap-view/lua/dap-view/watches/actions.lua:18: in function 'callback'
	...re/nvim/lazy/nvim-dap-view/lua/dap-view/watches/eval.lua:52: in function 'callback'
	...re/nvim/lazy/nvim-dap-view/lua/dap-view/watches/eval.lua:161: in function 'callback'
	...hanr/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1073: in function <...hanr/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1070>

I opened this plugin while running the debugger: https://github.com/kndndrj/nvim-dbee

When I closed that buffer, the above error got thrown

Also other strange things start happening:

image

@igorlfs
Copy link
Owner Author

igorlfs commented May 5, 2025

                     Error executing vim.schedule lua callback: ...re/nvim/lazy/nvim-dap-view/lua/dap-view/watches/view.lua:92: Invalid window id: 1226

I opened this plugin while running the debugger: https://github.com/kndndrj/nvim-dbee

When I closed that buffer, the above error got thrown

It's been a while since I used nvim-dbee, but IIRC it's really awkward at handling tabs. They must be closing the tab containing nvim-dap-view's windows, which is not handled properly. NOOPing in such cases is an easy alternative. This change, however, is unrelated to this PR. Since it also affects other views (scopes + REPL + Console), I'll solve this issue soon after merging.

@igorlfs igorlfs merged commit adbe984 into main May 6, 2025
2 checks passed
@igorlfs igorlfs deleted the feat/expand-variables branch May 6, 2025 00:12
@igorlfs
Copy link
Owner Author

igorlfs commented May 6, 2025

NOOPing in such cases is an easy alternative.

After 9d620a7, can you confirm you're no longer having the aforementioned issue? If the issue persists, can you open a new issue with steps for reproduction?

@RizaHKhan
Copy link

NOOPing in such cases is an easy alternative.

After 9d620a7, can you confirm you're no longer having the aforementioned issue? If the issue persists, can you open a new issue with steps for reproduction?

It does still persist, but it also isn't a deal breaker. Loving the changes so far and made this my daily driver for debugging.

@igorlfs
Copy link
Owner Author

igorlfs commented May 7, 2025

It does still persist

Can you please open a new issue? Try to reproduce the issue without nvim-dbee

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewriting the Watches view

3 participants