Skip to content

Commit

Permalink
Cleanup the debug-input messages we send
Browse files Browse the repository at this point in the history
  • Loading branch information
Malabarba committed Oct 3, 2015
1 parent 61ff50e commit 442de8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 8 additions & 4 deletions cider-debug.el
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,14 @@ specific message."
(symbol-name last-command-event)
(cdr (assq last-command-event cider--debug-mode-commands-alist)))
nil))
(cider-nrepl-send-request
(list "op" "debug-input" "input" (or command ":quit")
"key" (or key (nrepl-dict-get cider--debug-mode-response "key")))
#'ignore)
(let* ((conn (cider-current-connection))
(id (nrepl-send-request

This comment has been minimized.

Copy link
@bbatsov

bbatsov Oct 4, 2015

Member

Ideally we shouldn't be using nrepl-client directly outside cider-client.

This comment has been minimized.

Copy link
@Malabarba

Malabarba Oct 4, 2015

Author Member

Maybe refactor this into a function in cider-client then? cider-send-unhandled-request?

This comment has been minimized.

Copy link
@bbatsov

bbatsov Oct 4, 2015

Member

Fine by me.

(list "op" "debug-input" "input" (or command ":quit")
"key" (or key (nrepl-dict-get cider--debug-mode-response "key")))
#'ignore
conn)))
(with-current-buffer conn
(nrepl--mark-id-completed id)))
(ignore-errors (cider--debug-mode -1)))

(defun cider--debug-quit ()
Expand Down
6 changes: 4 additions & 2 deletions nrepl-client.el
Original file line number Diff line number Diff line change
Expand Up @@ -892,14 +892,16 @@ server responses."
"Send REQUEST and register response handler CALLBACK using CONNECTION.
REQUEST is a pair list of the form (\"op\" \"operation\" \"par1-name\"
\"par1\" ... ). See the code of `nrepl-request:clone',
`nrepl-request:stdin', etc."
`nrepl-request:stdin', etc.
Return the ID of the sent message."
(let* ((id (nrepl-next-request-id connection))
(request (cons 'dict (lax-plist-put request "id" id)))
(message (nrepl-bencode request)))
(nrepl-log-message (cons '---> (cdr request)))
(with-current-buffer connection
(puthash id callback nrepl-pending-requests)
(process-send-string nil message))))
(process-send-string nil message))
id))

(defvar nrepl-ongoing-sync-request nil
"Dynamically bound to t while a sync request is ongoing.")
Expand Down

0 comments on commit 442de8f

Please sign in to comment.