From f1388d151c4966412f8270fa626c3efd29d2cc9a Mon Sep 17 00:00:00 2001 From: Mikhail Kuzmin Date: Sun, 4 Feb 2024 21:24:35 +0400 Subject: [PATCH] Add backwards compatibility. refs #846 --- src/cider/nrepl/middleware/debug.clj | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/cider/nrepl/middleware/debug.clj b/src/cider/nrepl/middleware/debug.clj index c10acf96..2b69c039 100644 --- a/src/cider/nrepl/middleware/debug.clj +++ b/src/cider/nrepl/middleware/debug.clj @@ -448,16 +448,18 @@ this map (identified by a key), and will `dissoc` it afterwards."} (defn looks-step-innable? "Decide whether a form looks like a call to a function that we could instrument and step into." - [env form] - (when (and (seq? form) (symbol? (first form))) - (let [v (resolve env (first form)) ; Note: special forms resolve to nil - m (meta v)] - ;; We do not go so far as to actually try to read the code of the function - ;; at this point, which is at macroexpansion time. - (and v - (safe-to-debug? (:ns m)) - (not (:macro m)) - (not (:inline m)))))) + ([form] + (looks-step-innable? nil form)) + ([env form] + (when (and (seq? form) (symbol? (first form))) + (let [v (resolve env (first form)) ; Note: special forms resolve to nil + m (meta v)] + ;; We do not go so far as to actually try to read the code of the function + ;; at this point, which is at macroexpansion time. + (and v + (safe-to-debug? (:ns m)) + (not (:macro m)) + (not (:inline m))))))) ;;; ## Breakpoint logic