-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter and control order of debugging prompt overlay commands #2731
Conversation
I think that's the wrong approach to solving the problem. As I mentioned in the original ticket I think that the debugger middleware should send back the list of supported commands, the client should decide on the key mappings internally and never send the keys back to the debugger, as it definitely doesn't need to know about those. The client and the middleware should communicate only in terms of the command names. Is this something you'd be willing to tackle? It's pretty straightforward, I've just been extremely busy with other stuff lately. |
Oh okay, I must have misunderstood the original conversation. Just to clarify, that would mean a change to In that way the communicated list can be considered an unsorted set, and it's the ordering and inclusion in the alist that would determine how the overlay is displayed? |
Yeah, exactly. Basically clients need to know only about the supported commands and they have to figure out key mappings themselves.
Exactly. As not all commands can be fitted on the screen probably at some point we should have some split between commands that are visible and those that are available, but hidden (e.g. they are not frequently used), but that's something for a later revision of this. The only reason why the keys are hardcoded today is that we didn't envision other clients of |
See clojure-emacs/cider-nrepl#654, |
Yeah, that's exactly what I had in mind. Apart from picking better names for commands like |
I just realised a bug with the current implementation - hidden commands like "Continue" can't be sent to the middleware, because the alist doubles as both the key mapping and the display spec. I'll go ahead and implement the display-name mapping later this evening, would you prefer it to be a separate alist variable or combined with the current one?
|
I'd go with a single list. I guess the third element can be completely optional, but explicit |
- This shifts the responsibility of key to command mappings to the client side, so the middleware only deals with a list of valid command names and not their key character mappings. - Introduce new custom alist variable `cider-debug-prompt-commands` which represents a mapping between characters and debug commands to send to the middleware. The ordering and inclusion of pairs in this list determines how the debugger overlay is displayed - Remove the local variable cider--debug-mode-commands-dict, since the new alist can perform this mapping.
to a list of (KEY COMMAND-NAME DISPLAY-NAME) specs
Small optimization as the formatting does not change across prompts and can be memoized
💯 |
As per the blocker on clojure-emacs/cider-nrepl#613, which is a feature I'm looking forward to :)
I rearranged the default alphabetical order of the commands to exclude
Continue
and group them more semantically, here's what it looks like:Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
make test
)make lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.