spacemacs

Spacemacs docs: http://develop.spacemacs.org/doc/DOCUMENTATION.html http://develop.spacemacs.org/layers/+lang/clojure/README.html https://practicalli.github.io/spacemacs/
zane 2020-06-10T02:04:38.394800Z

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 πŸ™‚).

zane 2020-06-10T02:11:37.395Z

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.

2020-06-10T13:05:38.396900Z

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?

practicalli-john 2020-06-10T13:20:49.400200Z

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.

πŸ‘ 1
πŸ™‚ 1
2020-06-13T14:47:18.416900Z

ctrl z does seem to put me into another mode, but hitting "i" after that doesn't seem to step into the function?

practicalli-john 2020-06-13T16:30:36.417200Z

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.

2020-06-13T16:40:31.417400Z

> 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.

practicalli-john 2020-06-13T16:50:30.417600Z

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.

practicalli-john 2020-06-13T16:51:35.417900Z

I can step into bar when debugging foo, although I used a string so it crashed πŸ™‚ Will try with a number.

practicalli-john 2020-06-13T16:59:18.418100Z

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.

practicalli-john 2020-06-13T17:07:59.418600Z

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.

2020-06-13T18:16:43.419200Z

thanks, ill give it a try!

2020-06-13T18:17:00.419400Z

ill follow the bug too. so hopefully i know when i can stop doing that

2020-06-14T12:30:52.419700Z

i get the same behavior you got. cool cool

mathpunk 2020-06-10T17:14:33.402600Z

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:

practicalli-john 2020-06-10T17:43:52.403700Z

@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.

practicalli-john 2020-06-10T17:45:12.404800Z

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

nmkip 2020-06-10T18:53:32.405300Z

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"`

nmkip 2020-06-10T18:54:17.405500Z

If it doesn't work, restart spacemacs after creating that file.