-
Notifications
You must be signed in to change notification settings - Fork 176
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
Debugger incorrectly steps through conditional forms #437
Comments
@FiV0 You might consider taking a stab at this one as well. |
@bbatsov Had seen it. You can assign it to me if you want. |
@bbatsov @vspinu For this one I need some pointers/help. Consider the following code #dbg
#?(:cljs (+ 1 2) :clj (inc (inc 1))) In the cider-nrepl/src/cider/nrepl/middleware/debug.clj Lines 612 to 617 in f71b851
the code is still in string form, so something like "#dbg\n#?(....)". Once the evaluation gets to instrument-and-eval cider-nrepl/src/cider/nrepl/middleware/debug.clj Lines 594 to 597 in f71b851
the code has been "read" as clojure data and the form is just (inc (inc 1)) , so somewhere in between some reading seems to happen. I am assuming this happens in some lower handler in the nrepl. Is that correct? Essentially when reading such a form we need to do something like (read-string {:read-cond :preserve} "#dbg\n#?(....)") as otherwise the bookkeeping of where stuff is located fails.Maybe it's this line? https://github.com/nrepl/nrepl/blob/1cc9baae631703c184894559a2232275dc50dff6/src/clojure/nrepl/middleware/interruptible_eval.clj#L110-L111 |
Yeah, I think that's the line. nREPL basically just delegates to Clojure's own REPL, so it wouldn't have to reimplement its functionality. |
@bbatsov You think it would be ok to add an option to nrepl so that code is read with |
Probably that'd be fine. What exactly does |
Once #435 is in, try
The debugger within
:clj
form breaks almost immediately.The text was updated successfully, but these errors were encountered: