Fork me on GitHub
#cider
<
2017-01-30
>
jfntn15:01:57

The latest version of cider broke cljs repl type customization for me, no matter the value of cider-cljs-lein-repl cider always starts a rhino repl with cider-jack-in-clojurescript

jfntn15:01:49

I used to just set (cider-cljs-lein-repl . "(do (load-file \”script/dev.cljc\"))") in my .dir-locals.el, I also tried using setq but I get the same behavior

richiardiandrea15:01:38

@jfntn latest Snapshot? Can you open an issue, if it is the latest Snapshot I changed some stuff in there

dpsutton15:01:23

richiardi, didn't you rename that var?

jfntn15:01:24

@richiardiandrea yes I saw that, was about to mention you 😉 Any ideas how I might go about trying to fix this in the meantime?

richiardiandrea16:01:06

No I did not rename the var, I added to that boot and Gradle var and a cider-cljs-repl-form that queries depending on the project

richiardiandrea16:01:43

Maybe the logic is a bit off, I tried to reproduce the old behavior (of course), I will have a look today

richiardiandrea16:01:27

Thanks for reporting and sorry about that @jfntn

dpsutton16:01:17

ah. were you going to rename it at one point and decided not to?

dpsutton16:01:24

just wondering where I got that wrong impression

richiardiandrea16:01:29

Ok I think I saw what is going on

dpsutton16:01:39

and now i remember yall deciding not to and keeping the gradle stuff around

richiardiandrea16:01:05

Yep but it will be another pr, Gradle is all over cider 😄

richiardiandrea17:01:25

@dpsutton do you know what I need to add to my init.el in order to format elisp code correctly (for instance describe in cider tests) ?

dpsutton17:01:47

i've never done it before though

richiardiandrea17:01:49

yeah that's for clojure, what about elisp?

dpsutton17:01:58

i've seen it before

dpsutton17:01:02

but only in the definition of macros

dpsutton17:01:08

but i've seen what you're talking about

dpsutton17:01:17

what did i do

dpsutton17:01:22

i went to the definition of the macro

dpsutton17:01:24

and eval-ed it

dpsutton17:01:36

because it was only brought in after the autoloads

dpsutton17:01:58

so, navigate to source, C-M-x that badboy, pop back out to your describe form and reformat it

dpsutton17:01:59

it should work

dpsutton17:01:11

its because you haven't loaded all of buttercup yet

dpsutton17:01:16

just the autoloads

richiardiandrea17:01:21

yes I don't think I have

richiardiandrea17:01:49

thanks I'll play with it

dpsutton17:01:55

let me know if that works

dpsutton17:01:00

i remember that working for me

richiardiandrea17:01:20

mmm if I require it I don't even have it in my emacs packages...ok

dpsutton17:01:32

its brought in transitively i think

richiardiandrea17:01:40

I will format manually, I want to try that problem above

dpsutton17:01:42

oh you mean in your elpa directory?

richiardiandrea17:01:54

I don't use elpa

richiardiandrea17:01:01

but that's another story 😄

richiardiandrea17:01:38

uhm, the test succeeds

richiardiandrea17:01:10

not a very big elisp user here but:

(describe "cider-cljs-repl-form"
          (before-each
           (setq-local cider-cljs-lein-repl "(do (load-file \"script/dev.cljc\"))"))
          (describe "when there overriding cider-cljs-lein-repl"
                    (it "returns the overridden form not the default"
                        (expect (cider-cljs-repl-form "lein") :to-equal "(do (load-file \"script/dev.cljc\"))"))))

richiardiandrea17:01:57

uhm scratch that there is indeed a problem

jfntn17:01:39

@richiardiandrea ok cider-cljs-repl-form works as expected with a cl-cases instead of a pcase

richiardiandrea17:01:08

it is weird, I have a successful test

richiardiandrea17:01:25

what is the difference if I may ask? not a big elisp user

jfntn17:01:39

not sure to be honest, I don’t understand pcase

jfntn17:01:52

Hmm actually it might need more debugging because eventhough it says “starting a custom repl” nrepl doesn’t actually run my script

jfntn18:01:22

what’s the testing library?

richiardiandrea18:01:25

@jfntn did you try to ielm on your buffer

richiardiandrea18:01:40

in cider you just make clean test

jfntn18:01:54

it seemed to work once, but now I get a make test error running the test suite

jfntn18:01:01

will need to investigate later

richiardiandrea18:01:34

ok, whenever you have time, I will open a PR with the tests, we can talk there as well

richiardiandrea18:01:44

Ran 254 specs, 0 failed, in 2.3 seconds.

jfntn18:01:05

oh I do get 1 failure though for something unrelated

jfntn18:01:27

Could be an emacs version thing, I built from master recently

richiardiandrea18:01:57

ah, then it could be

richiardiandrea18:01:29

@jfntn PR opened, thanks for reporting, you pushed me to add tests 😄

dpsutton19:01:05

@jfntn is the failure related to the new clj/cljs reader font lock thing?

dpsutton19:01:17

the test failure I mean

jfntn20:01:18

@dpsutton the test was reader conditional font-lock when cider is connected uses cider-reader-conditional-face

dpsutton20:01:32

that one fails on my machine but not the CIDER build tooling

dpsutton20:01:36

its confusing to me

jfntn20:01:22

difference in emacs versions maybe?

dpsutton20:01:28

i'm building off of master

dpsutton20:01:32

is that what you are doing as well?

dpsutton20:01:51

well there we go

dpsutton20:01:58

i'm on probably a 2month old commit or something

jfntn20:01:45

I have a more recent build `GNU Emacs 26.0.50.2 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G1004)) of 2017-01-15 `

richiardiandrea20:01:15

wow that's good that you guys try already against that

ag21:01:27

is cider-jack-in got broken, or I am missing something?

dpsutton21:01:13

what issues are you seeing?

dpsutton21:01:26

@ag i just jacked in from the latest 0.15 snapshot on windows

dpsutton22:01:14

what version are you on?

ag22:01:12

CIDER 0.15.0snapshot emacs 25.1.1

ag22:01:56

I have rebooted, trying again

dpsutton22:01:08

please let me know

dpsutton22:01:12

hope it works for ya

ag22:01:16

ok, it seems cider-jack-in works, cider-jack-in-clojurescript is broken though

dpsutton22:01:31

ah, I think @richiardiandrea is working on that

ag22:01:03

is there an issue where I can follow up?

richiardiandrea22:01:29

All the tests pass here, do you have a dir-locals.el?

ag22:01:35

@richiardiandrea null pointer exception and long stacktrace related to weasel

ag22:01:13

yes, and my dir-locals.el

((nil . ((cider-boot-parameters . "repl -s wait")
         (cider-cljs-lein-repl . "(boot (start))"))))

ag22:01:29

it was working yesterday

richiardiandrea22:01:55

Ok @ag for your case you need to change to boot-cljs-boot-repl

ag22:01:07

trying that

ag22:01:25

same thing 😞

richiardiandrea22:01:02

are you using boot-repl-cljs?

richiardiandrea22:01:30

ah yes it is written there

richiardiandrea22:01:41

I wonder what (boot (start)) is doing

richiardiandrea22:01:04

another thing is, you could try to remove the dir local

richiardiandrea22:01:26

because the default is to launch boot-cljs-repl/start-repl

ag22:01:33

(deftask start []
  (future (boot (dev)))
  identity)
it just wraps main task into a future, so it wouldn’t block the repl

richiardiandrea22:01:17

so basically you are launching two repls it seems

ag22:01:40

so it was working, nothing has changed except cider

richiardiandrea22:01:05

I would actually try this in your case:

((nil . ((cider-boot-parameters . "start")))))

richiardiandrea22:01:11

and you start will become

richiardiandrea22:01:58

(deftask start []
  (future (boot (dev)))
  (comp (repl :server true) (wait))

ag22:01:49

let me try that, because removing dir-locals didn’t help

richiardiandrea22:01:56

when you jack in, at the bottom you should see the task called that is matching your start

richiardiandrea22:01:16

it is basically same as my setup

ag22:01:53

can you paste exact content of .dir-locals.el please

richiardiandrea22:01:11

((nil . (cider-boot-parameters . "dev-web"))))

richiardiandrea22:01:26

which you will replace with start

richiardiandrea22:01:40

yes there was one parent more up there

ag22:01:09

problem not in parens, I spotted that, something else not right

ag22:01:14

something wrong with deftask I think

ag22:01:20

it’s not working in terminal either

richiardiandrea22:01:24

uhm, I did not try, let me see

ag22:01:06

oh, hold on… I think I missed paren there 🙂

richiardiandrea22:01:17

missing paren yeah

ag22:01:04

"try Lisps" they say, "parentheses not a problem” they say.

richiardiandrea22:01:39

ah ah, I should have add highlight maybe

richiardiandrea22:01:51

test

clojure
(deftask start []
  (future (boot (dev)))
  (comp (repl :server true) (wait))

richiardiandrea22:01:06

no it does not work like this 😄

dpsutton22:01:24

is it working now?

ag22:01:04

@richiardiandrea Holy shit!!! that worked… this is so cool. I can’t thank you enough… this been killing me for the past couple of hours

richiardiandrea22:01:32

no problem, that's good that it is solved!

ag22:01:29

you didn’t just fixed it, I couldn’t find a way to automatically start the cljs-repl, it would still have 2 separate clojure repls until I type in one of them (start-repl)

ag22:01:42

yooohooo!

richiardiandrea22:01:50

yeah your setup was a bit weird 😄

richiardiandrea22:01:11

by the way, I think you could get rid of repl :server wait even

richiardiandrea22:01:31

because cider will always launch two repls

richiardiandrea22:01:51

the second one is reduntant (unless you use it with another classpath)

ag22:01:44

well, to paraphrase Tolstoy: “All Sublime Text configs are alike; each Emacs config is weird and awesome in its own way"

richiardiandrea22:01:07

oh yeah Tolstoy for sure was using emacs 😄

ag22:01:37

you bet he did. that’s why he rejected orthodox church. he found better one

richiardiandrea22:01:05

that might actually be true, we should check the dates 😄

dpsutton22:01:34

@ag do you like having two repls open?

dpsutton22:01:48

i was always confused why emacs would launch two clojure repls and then make one a cljs repl

dpsutton22:01:54

and i wanted to do away with that

dpsutton22:01:59

(in the future)

dpsutton22:01:04

just getting ideas/opionions

ag22:01:08

@dpsutton absolutely, two separate clojure and clojurescript repls are amazing. Something I believe Cursive can’t do. Well it can’t do a lot more, to be honest

dpsutton22:01:19

i wouldn't preclude that

dpsutton22:01:28

but when you jack in clojurescript, you get a single clojure script repl

dpsutton22:01:35

and if you like, you could jack in to get a clojure repl

dpsutton22:01:46

i just don't get why it tries to do both automatically

ag23:01:21

@dpsutton I don’t get what you’re saying. They are both indeed clojure repls (until one of them starts cljs-repl), and even after one becomes cljs-repl there’s always way to do :cljs.quit and go back to clj repl

ag23:01:11

but why would you need 2 clojure repls? is that what you’re talking about

dpsutton23:01:52

that's my point, ag

dpsutton23:01:00

when you jack-in-clojurescript you get two repls

dpsutton23:01:15

but its actually a clojure repl, and a clojure repl that just invoked whatever you invoke to get a cljs repl

dpsutton23:01:19

so why not just make one?

dpsutton23:01:28

i don't understand why there are wto

dpsutton23:01:37

or why there are always two

ag23:01:16

when you do clojure-jack-in, you get one repl

dpsutton23:01:33

so why when you do clojurescript-jack-in do you get two?

ag23:01:19

because then you can evaluate clojure code in one and clojurescript code in another, without having to run :cljs.quit and (start-repl) back and forth

dpsutton23:01:47

is that a common use case in clojurescript projects?

dpsutton23:01:07

i'm not familiar with clojurescript, but it seems like they don't require a jvm at al

ag23:01:07

in my case it is

dpsutton23:01:15

then i'm glad i talked to you then 🙂

ag23:01:50

this is really cool, so you can go to clojure file, evaluate piece of code and see the results, and then you can go to clojurescript file and evaluate piece of clojurescript code and see the results.

ag23:01:12

really nice