Fork me on GitHub
#cider
<
2019-06-23
>
theeternalpulse07:06:12

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?

yuhan08:06:37

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.

yuhan09:06:24

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

bozhidar09:06:57

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

bozhidar09:06:36

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

yuhan09:06:30

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:

yuhan09:06:04

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

bozhidar09:06:28

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.

bozhidar09:06:58

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

carkh11:06:34

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

carkh11:06:01

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

carkh11:06:35

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

carkh12:06:41

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

carkh12:06:13

works for unix, works (somewhat better) for windows

lread12:06:29

This might provide some related relevant info https://clojure.atlassian.net/browse/TDEPS-133

carkh12:06:59

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

carkh12:06:03

and it works

carkh12:06:33

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

oskarkv14:06:59

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

oskarkv14:06:16

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

oskarkv14:06:02

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

dpsutton14:06:27

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?

oskarkv14:06:54

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? 😛

dpsutton15:06:37

looks like a temp file