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

Add collape all and expand all actions for the variables widget

Open miroshQa opened this issue 1 year ago • 2 comments

Problem Statement

Currently, to fully expand deeply nested variables, we need to manually press Tab on each entry. It would feel more convenient to have an expand-all/collapse-all action that recursively expands or collapses variable

Possible Solutions

Add new mapping to fully expand or collapse an entry and mention it in the readme, for example:

The widgets may have the following custom mappings enabled:
- `<CR>` to expand or collapse an entry
- `<S-CR>` to fully expand/collapse an entry recursively
- `a` to show a menu with available actions

Considered Alternatives

No response

miroshQa avatar Mar 30 '25 11:03 miroshQa

Note: I’ve just discovered that the current collapse implementation for entries works as a "collapse-all" action https://github.com/mfussenegger/nvim-dap/blob/7aade9e99bef5f0735cf966e715b3ce45515d786/lua/dap/ui.lua#L246C1-L248C8

miroshQa avatar Mar 30 '25 11:03 miroshQa

My current plan for this was to allow CR in visual mode to expand a selection, but given that children can be fetched asynchronously that's currently a bit tricky to implement so I wanted to rework the tree mechanism first a bit more - also having in mind to make a proposal for a vim.ui.tree widget in neovim core. But this will be some time before I get to that.

mfussenegger avatar Apr 10 '25 15:04 mfussenegger