Skip to content

Commit

Permalink
Add backwards compatibility. refs clojure-emacs#846
Browse files Browse the repository at this point in the history
  • Loading branch information
darkleaf committed Feb 4, 2024
1 parent 927d144 commit f1388d1
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/cider/nrepl/middleware/debug.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f1388d1

Please sign in to comment.