From 607acf96f209be9e7678fb2992b768e4914961e4 Mon Sep 17 00:00:00 2001 From: Edipo L Federle Date: Fri, 18 Dec 2015 17:06:33 -0200 Subject: [PATCH 1/3] Update nREPL requests. nrepl-send-string -> nrepl-request:eval nrepl-send-string-sync -> nrepl-sync-request:eval --- expectations-mode.el | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/expectations-mode.el b/expectations-mode.el index 31432ac..550e3d7 100644 --- a/expectations-mode.el +++ b/expectations-mode.el @@ -110,11 +110,16 @@ (defun expectations-eval (string &optional handler stdout-handler synch) (if synch (funcall handler (current-buffer) - (plist-get (nrepl-send-string-sync string (cider-current-ns)) :value) + (plist-get (nrepl-sync-request:eval string (cider-current-connection) (cider-current-session) (cider-current-ns)) :value) synch) - (nrepl-send-string string - (expectations-response-handler (or handler #'identity) stdout-handler) - (cider-current-ns)))) + + (cider-nrepl-send-request + (list "op" "eval" + "ns" (cider-current-ns) + "code" string + "session" (cider-current-session)) + (expectations-response-handler (or handler #'identity) stdout-handler)))) + (defun expectations-test-clear (&optional callback synch) "Clear all counters and unmap generated vars for expectations" @@ -257,8 +262,8 @@ it." (let* ((ns (match-string 2)) (filename (read - (plist-get (nrepl-send-string-sync (format "(-> \"%s\" symbol ns-publics first val meta :file)" ns) - (cider-current-ns)) + (plist-get (nrepl-sync-request:eval (format "(-> \"%s\" symbol ns-publics first val meta :file)" ns) + (cider-current-connection) (cider-current-session) (cider-current-ns) ) :value)))) (list filename))) @@ -324,7 +329,7 @@ it." (sort-by (comp :line meta) (vals (ns-publics (find-ns '%s))))))" (line-number-at-pos) (cider-current-ns)))) - (plist-get (nrepl-send-string-sync clj (cider-current-ns)) :value))) + (plist-get (nrepl-sync-request:eval clj (cider-current-connection) (cider-current-session) (cider-current-ns)) :value))) (defun expectations-run-test (&optional synch) "Run test at point" From 3585d801a847c5611a270896543443e458adeb79 Mon Sep 17 00:00:00 2001 From: Edipo L Federle Date: Fri, 18 Dec 2015 18:40:59 -0200 Subject: [PATCH 2/3] use repl-dict-get --- expectations-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expectations-mode.el b/expectations-mode.el index 550e3d7..fe560f8 100644 --- a/expectations-mode.el +++ b/expectations-mode.el @@ -329,7 +329,7 @@ it." (sort-by (comp :line meta) (vals (ns-publics (find-ns '%s))))))" (line-number-at-pos) (cider-current-ns)))) - (plist-get (nrepl-sync-request:eval clj (cider-current-connection) (cider-current-session) (cider-current-ns)) :value))) + (nrepl-dict-get (nrepl-sync-request:eval clj (cider-current-connection) (cider-current-session) (cider-current-ns)) "value"))) (defun expectations-run-test (&optional synch) "Run test at point" From 626fe4817be91121535b71474ca9914758762a07 Mon Sep 17 00:00:00 2001 From: Edipo L Federle Date: Fri, 18 Dec 2015 19:12:25 -0200 Subject: [PATCH 3/3] use repl-dict-get all places --- expectations-mode.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/expectations-mode.el b/expectations-mode.el index fe560f8..800057b 100644 --- a/expectations-mode.el +++ b/expectations-mode.el @@ -110,7 +110,7 @@ (defun expectations-eval (string &optional handler stdout-handler synch) (if synch (funcall handler (current-buffer) - (plist-get (nrepl-sync-request:eval string (cider-current-connection) (cider-current-session) (cider-current-ns)) :value) + (nrepl-dict-get (nrepl-sync-request:eval string (cider-current-connection) (cider-current-session) (cider-current-ns)) "value") synch) (cider-nrepl-send-request @@ -262,9 +262,9 @@ it." (let* ((ns (match-string 2)) (filename (read - (plist-get (nrepl-sync-request:eval (format "(-> \"%s\" symbol ns-publics first val meta :file)" ns) + (nrepl-dict-get (nrepl-sync-request:eval (format "(-> \"%s\" symbol ns-publics first val meta :file)" ns) (cider-current-connection) (cider-current-session) (cider-current-ns) ) - :value)))) + "value")))) (list filename))) (defun expectations-kill-compilation-buffer ()