Fork me on GitHub

When running some of the test functions, i notice it doesn't eval beforehand, is there a setting to have cider save/eval before, or do I just have to bind to a custom fn that does that?


On my local branch of cider I simply edited cider-test-run-test to do (cider-eval-defun-at-point) before executing the test in a clojure-mode buffer, there doesn't seem to be an existing setting for it.


I think it should be a default behaviour, it doesn't make sense to edit a test and then run the outdated version


Yeah, that’s reasonable. Probably we can also do this for namespaces as well.


I think we avoided it initially simply because we didn’t want to trigger unwanted side-effects from the code under test.


FWIW, Spacemacs does a more extreme version of this by default, binding <leader>t t to a custom fn that re-evals the entire buffer before running the test:


(defun spacemacs/cider-test-run-focused-test ()
  "Run test around point."


Well, that’s an easy change and I’d be fine with adding customizations to auto-eval the test at point or the entire buffer.


There’s also a cider-auto-test mode which does a similar thing when it’s enabled and you’re changing code.


@bozhidar it had been a good long while since i've been doing clojure stuff (rather than clojurescript). Now i'm hitting a problem with cider specific to windows and deps.edn project. When i try to jack-in and select "clojure-cli", i get "the clojure executable isn't on your 'exec-path'"... This is completely normal as there is no clojure command to execute, it lives in powershell, there is no file to execute. While doing shadow-cljs work, i worked around this by having a clojure.cmd file in the root of my project directory, which, i guess, shadow-cljs was calling. This in turn was executing poweshell and the clojrue command within it. Looking at the source code in cider.el I think I already see one problem : you're looking for .bat files and not .cmd, both should be looked up. I cannot put this clojure.cmd (or .bat) file in the path, because then powershell will recurse calling it, rather than using its internally added clojure command. So i'll rename my cmd file to a bat file, but how can i make cider call it in the root of my project ?


would adding . to the exec-path emacs variable do it ?


ok that works, but i'm back with the different interacting escape of quotes issues


i think in this regard, calling clojure with double quotes outside the -Sdeps parameter rather than single quotes, and \" inside that string is the most compatible way to do it


works for unix, works (somewhat better) for windows


This might provide some related relevant info


then changed cider.el to use the double quote parameters with escaped double quotes inside those


and it works


but i need to test this in a unix before maybe submitting a pr ?


I'm using figwheel-main, doing a cider-jack-in-cljs, and almost everything works, I get a [Figwheel] Successfully compiled, it opens my browser on the dev page, but my clj repl doesn't turn into a cljs repl, and the repl doesn't seem to work. I don't get any error message and I don't know what's wrong. It worked yesterday but I can't figure out what is different today. 😕


If I try to use the repl it gets stuck with that loading animation going on -> [=== ]


Anybody know what's wrong, or how I can find out what's wrong?


does your deps.edn file have any main or main args (i forget what its called). Tutorials for figwheel-main tell you to set some main args. If you put these, CIDER cranks up unhappy. If you omit them, it works just fine. Is this perhaps your issue?


Hm I found this in my project directory lrwxrwxrwx 1 oskar oskar 28 Jun 23 16:34 .#core.cljs -> [email protected]:1561292340 and removed it, and now it works. What was that? 😛


looks like a temp file