- Notifications
You must be signed in to change notification settings - Fork 181
Debugger fixes #552
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 fixes #552
Conversation
@vspinu seems there's some real CI failure this time around:
|
Yes. A lot of tests rely heavily on debugger internals. Will have a look tomorrow. I was deceived by Will label WIP for time being. |
I never used this - only |
src/cider/nrepl/middleware/debug.clj Outdated
[orchard.meta :as m] | ||
[clojure.java.io :as io]) | ||
[clojure.java.io :as io] | ||
[cider.nrepl.middleware.util.nrepl :refer [notify-client]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really need to sort the deps in this namespace. :-)
src/cider/nrepl/middleware/debug.clj Outdated
'[clojure.tools.nrepl.middleware.session :as session] | ||
'[clojure.tools.nrepl.misc :refer [response-for]] | ||
'[clojure.tools.nrepl.transport :as transport]) | ||
'[clojure.tools.nrepl.middleware.interruptible-eval :refer [*msg*]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original indentation seems correct to me. Do you have non-default settings for indentation in clojure-mode
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Standard settings. The new indentation seems correct to me (2 spaces).
But I do see problems indenting macros in cider-nrepl project. The {:style/indent 1}
in try-if-let
in debug.clj
is not taking effect. Could you please confirm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For ordinary lists the indentation is 1-space. I just check this.
try-if-let
is broken for me as well. I also notice it's not font-locked as a macro
, which is an indication of a deeper problem with dynamic font-locking/indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually had clojure-indent-style
set to non-default value and that was causing the indent. Shall we add this to .dir-locals?
src/cider/nrepl/middleware/debug.clj Outdated
{:status :eval-error | ||
:causes [(let [causes# (stacktrace/analyze-causes e# (:pprint-fn *msg*))] | ||
(when (coll? causes#) (last causes#)))]}))) | ||
{:status :eval-error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems like a another accidental change of indentation.
src/cider/nrepl/middleware/debug.clj Outdated
:stacktrace (-> (Exception. "Dummy") | ||
(stacktrace/analyze-causes (:pprint-fn *msg*)) | ||
last :stacktrace)}]})) | ||
{:status :stack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
| ||
(def debug-commands | ||
{"c" :continue | ||
"C" :Continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should probably give the keyword some different name. (more descriptive)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any concrete ideas? I thought of :Continue-all
or :Continue-non-stop
but both of them take valuable horizontal space during the debugger display.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should probably decouple this a bit from the UI (but that's an unrelated note), so we can provide a more compact view for people who actually know the commands.
I like :continue-non-stop
, but I have to check with other debuggers. I'd also suggest using a lowercase letter as those are simpler to press.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am quite indifferent on this but I think C
is not bad here. It should be rarely used and C
is suggestive that it's a more complex version of c
command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Debugger's menu says "Continue non stop", so I guess it should be fine as a first try.
src/cider/nrepl/middleware/debug.clj Outdated
(assoc dbg-state :inspect) | ||
(recur value)) | ||
(recur value dbg-state)) | ||
(->> (debug-inspect page-size val) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your indentation is incorrect in all try-if-let
forms.
Apart from the few accidental indentation changes and a couple of small remarks the changes look good to me. Might be nice to add a couple of tests for them. And as usual - amazing work! The users are going to be super excited about those improvements! |
I am no longer able to run cider tests interactively. With current master when run interactively tests in Would you mind checking on your side if you could run any of the |
They freeze for me as well. No idea why, though. I can't think of any related changes. |
Yeah, totally. On Tue, 16 Oct 2018 at 18:52, Vitalie Spinu ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In src/cider/nrepl/middleware/debug.clj <#552 (comment)> : > (:import [clojure.lang Compiler$LocalBinding])) ;; Compatibility with the legacy tools.nrepl and the new nREPL 0.4.x. ;; The assumption is that if someone is using old lein repl or boot repl ;; they'll end up using the tools.nrepl, otherwise the modern one. (if (find-ns 'clojure.tools.nrepl) (require - '[clojure.tools.nrepl.middleware.interruptible-eval :refer [*msg*]] - '[clojure.tools.nrepl.middleware.session :as session] - '[clojure.tools.nrepl.misc :refer [response-for]] - '[clojure.tools.nrepl.transport :as transport]) + '[clojure.tools.nrepl.middleware.interruptible-eval :refer [*msg*]] I actually had clojure-indent-style set to non-default value and that was causing the indent. Shall we add this to .dir-locals? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#552 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGVytP4tvTjitItWjbicBGMx_-mV8s_ks5ulg7ggaJpZM4XdL_B> . -- Best Regards, Bozhidar Batsov http://www.batsov.com |
👌 On Tue, 16 Oct 2018 at 19:25, Vitalie Spinu ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In src/cider/nrepl/middleware/debug.clj <#552 (comment)> : > (def debug-commands {"c" :continue + "C" :Continue The Debugger's menu says "Continue non stop", so I guess it should be fine as a first try. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#552 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAGVyokEYikjraWuvtQpUsZuC4PceNtaks5ulhaggaJpZM4XdL_B> . -- Best Regards, Bozhidar Batsov http://www.batsov.com |
eba4840
to 0780d91
Compare 0780d91
to efa335d
Compare efa335d
to 06d0cd6
Compare Should be good to go. There is an unrelated pprint failure in one job. |
Two changes:
debugger forms are now localized in the sense that STATE__ is inserted where the reader form is located and not around the entire defun. Besides fixing non-closure situations as in Bugfix: Debugging deftype Forms #544 it is' likely to be useful in core-async contexts (macros with &env) for which there are a few issues open. Still have to check those.
implement a notion of a debugger session and build on top of it to fix a range of "continue" issues
There are now two
continue
commands, one local which stops on next#dbg
or#break
readers, and one global which behaves like the oldcontinue
. First one is now onc
and the global on is onC
.I want to fix a few more debugger related issues but it seems wise to push these changes first so that people could start testing immediately.