Skip to content

Clean up the debugger menus and fix the force step-out key#4076

Merged
bbatsov merged 3 commits into
masterfrom
debugger-cleanup
Jul 5, 2026
Merged

Clean up the debugger menus and fix the force step-out key#4076
bbatsov merged 3 commits into
masterfrom
debugger-cleanup

Conversation

@bbatsov

@bbatsov bbatsov commented Jul 5, 2026

Copy link
Copy Markdown
Member

This pulls together a few debugger fixes and a bit of cleanup.

The menu-bar menu and the transient menu each listed the full set of debugger commands by hand, and they had drifted: the menu-bar menu showed the wrong key for inject (i instead of j) and was missing step-in, stacktrace and trace. Both menus are now generated from a single cider--debug-commands catalog, so they stay in sync.

While tracing the command dispatch I found that the O (force step-out) key was broken: it sent a :force-out command, which the middleware does not have (force-out is :out with a force? flag), so pressing it aborted the session with an error. That is fixed too.

Commits:

  • Generate the debugger menus from a single command catalog.
  • Fix the debugger's O (force step-out) key.
  • Add a round-trip test for the debugger coordinate finder (cider--debug-find-coordinates-for-point, the inverse of cider--debug-move-point, which had no direct coverage).

eldev test, eldev compile and checkdoc are all clean.

bbatsov added 3 commits July 5, 2026 16:36
The menu-bar menu and the transient menu each spelled out the full list
of debugger commands by hand, so they had already drifted: the menu-bar
menu advertised the wrong key for inject and was missing step-in,
stacktrace and trace.

Introduce `cider--debug-commands' as the one place that lists the
commands (key, function, label, group) and generate both menus from it,
so they can't fall out of sync again.
Pressing `O` in a debug session sent a `:force-out` command, but the
middleware has no such command: force-out is `:out` sent with a `force?`
flag. The unknown command aborted the session and raised an error.

Map the `O` key to the `out` command so the uppercase-key force handling
in `cider-debug-mode-send-reply' produces a proper forced `:out`, which
matches what the menu and `cider-debug-force-out` already send.
`cider--debug-find-coordinates-for-point' is the inverse of
`cider--debug-move-point', but only the latter was covered. Test that
feeding the finder's result back into `cider--debug-move-point' lands on
the same spot.
@bbatsov bbatsov force-pushed the debugger-cleanup branch from 423e0ef to e64ec85 Compare July 5, 2026 13:37
@bbatsov bbatsov merged commit 5dceb6c into master Jul 5, 2026
12 checks passed
@bbatsov bbatsov deleted the debugger-cleanup branch July 5, 2026 13:47
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.

1 participant