Note that thatβll indent other forms like ->
in ways that violate the community style guide (which may or may not be a problem for you π).
If you want to avoid that you can use https://docs.cider.mx/cider/config/indentation.html#macro-indentation to tell CIDER what to do with expecting
in particular.
I suspect vim's "insert" is given higher priority then cider's "in" (as in "step in", with the debugger context). How do i verify that and whats the best way to change it?
It seems many of us just work around the issue using C-z
to switch to Emacs editing mode, then the same to switch back to evil when finished with the cider debugger. Would be good to get this fixed for evil though.
ctrl z does seem to put me into another mode, but hitting "i" after that doesn't seem to step into the function?
Not something I am that familiar with. Is it just a particular piece of code you cannot step into, or is it several different pieces of code showing the same behavior? I doesnt seem that the debugger creates a break point everywhere, so if its just happening to specific code I wonder if its just not getting a break point? I've only stepped over functions (especially though that generate large data sets). I assume you are trying to step into the next function rather than the current function. Happy to try some code examples with the debugger if you are able to share.
> I assume you are trying to step into the next function rather than the current function. Yep. Examples wise. It fails on anything
(defn bar [x] (inc x))
(defn foo [x] (bar x))
If i select foo and tell cider to debug it on eval. then eval foo with an arg, hitting I always enters insert mode. hitting ctrl-z puts me in another mode, but hitting "i" still doesn't drop into bar when the bar s-expression isn't selected.C-z
should switch to emacs editing state (blue cursor). I do this from Emacs evil state although it seems to work just as well from Evil insert state too.
I can step into bar when debugging foo, although I used a string so it crashed π Will try with a number.
It works for me. I have the two function, foo and bar and starting in Emacs normal state.
I use , d b
with the cursor on (def foo ,,,)
to add breakpoints to the foo
function definition.
I have (foo 9)
as a function call, which I evaluate with , e f
Then C-z
to switch to Emacs editing state
i
with the cursor still on x to jump into the bar function, the cursor jumps to the x in the bar definition
(its too late to step into the bar function when the cursor is on bar, as its already evaluated bar and showing the result)
n
to show the result of inc x
n
to show the result of bar x
n
to finish with the result showing on (foo 9) function call...
You could instrument both functions, which is viable in small example, however, it would be impractical when there are many functions you want to step into that are called by a function, or when those function call other functions that you want to step into... etc.
There is an issue open on the Spacemacs GitHub repo about the cider debug keys and Evil: https://github.com/syl20bnr/spacemacs/issues/13594 If I knew how to start fixing it, I would be happy to work on it. I assume it needs some kind of evilification, or a cider debug transient state seems a useful approach. I will try find some time to look for examples, as this must have been done may times before for other packages.
thanks, ill give it a try!
ill follow the bug too. so hopefully i know when i can stop doing that
i get the same behavior you got. cool cool
First time developing Clojure in a while so my tools may be out of date. I'm going by the Practicalli guide, and I started the project with Sean Corfield's clj-new. If I use , t a
I get a message, "No assertions (or no tests were run). Did you forget to use 'is' in your tests?" But if I view the boilerplate test and run , t t
I get a nice pretty output window. :thinking_face:
@mathpunk Also try , t n
to run all the tests in the current namespace, it should load the tests into the REPL too, so you dont always have to evaluate them. (adding this to the book quickly)
To make certain the tests run, they should be evaluated (just like functions in the src code), so , e f
for individual fuctions or , e b
for the whole namespace (buffer).
If you change the name of a deftest, use , e u
to unevaluate that test first or it will keep running until you restart the repl.
When using the CIDER test runner, you will need to add the test
path somewhere in the deps.edn
of the project too https://practicalli.github.io/spacemacs/testing/unit-testing/cider-test-deps-edn-projects.html
Also if you have test dependencies under an alias, create the M-x add-dir-local-variable
and add cider-clojure-clj-global-options
with your alias, for example:`"-A:test"`
If it doesn't work, restart spacemacs after creating that file.