Fork me on GitHub
#cursive
<
2015-12-04
>
jaen08:12:16

@kenny: you don't really connect to boot cljs repl. You connect to boot's clj repl and then run (adzerk.boot-cljs-repl/start-repl) from there and it switches the current repl to talk to the browser.

jaen08:12:48

(things defined/refered from build.boot are visible from boot.user namespace boot cljs repl starts in, so you can define a convenience function that calls that and/or refer that var)

rauh12:12:39

Minor annoyance: I keep getting a reflection warning for printStackTrace whenever I print a stacktrace

cjmurphy13:12:52

It would also be ideal if, when cursor is positioned at the end of a hyphenated name-like-this, Cntl Backspace removed the whole thing in one go. Similar to the turtling issue (now fixed but only with key re-binding).

alexmiller14:12:20

@rauh: why not just use the pst function?

roelof15:12:21

@cjmurphy: do you get a message when there is a new version of cursive ?

cjmurphy15:12:58

@roelof I get nagged about new versions of IDEA. I'm not exactly sure what happens with plugins. I'm still on 14.1.5 of IDEA.

roelof15:12:01

oke, I work on 15.0.1

roelof15:12:21

I ask because you said that one of these days a new version of cursive will come out and I hope my template problem is solved

rauh16:12:17

@alexmiller: It's when I use Cursive's own Print last exception function that I get the reflection warning.

cjmurphy16:12:38

I did once try to get a REPL from within Cursive but gave up after an out of memory error. I can get a lein repl going from a windows console easily enough. On my 'to do list' is to have a REPL that comes up and is already in a particular namespace (where I do the 4 Clojure Koans). Items in my 'to do list' are sometimes represented as SO questions: http://stackoverflow.com/questions/33982533/clojure-boot-repl-in-a-particular-namespace

kenny19:12:18

@jaen: I run cljs-repl and then boot repl -c and (start-repl) in the REPL. When I open the REPL pane in IntelliJ it is still Clojure. I can tell this by executing (+ 1 "1"). This would work in cljs and show a warning but in Clojure I just get a ClassCastException.

jaen19:12:22

Hm, interesting, I'll have to re-check, but I'm pretty sure Cursive was smart enough to change to cljs repl automatically

kenny19:12:42

Is there some sort of configuration setting I need to set?

jaen19:12:49

None that I know of

jaen19:12:08

It Just Worked™ for me

kenny19:12:45

Where are you running boot repl?

jaen19:12:33

(deftask dev []

  (comp
    (watch)
    ...
    (bcr/cljs-repl)
    (bc/cljs ...)
    ...)

(defn cljs-repl! []
  (bcr/start-repl))

jaen19:12:42

Are the relevant parts of my build.boot

jaen19:12:52

Then I just boot dev from a terminal.

danielcompton19:12:07

@roelof: I think IntelliJ checks in the backgrounds for updates to plugins

jaen19:12:08

And I have a remote REPL type run config added

jaen19:12:37

With Use Leiningen nREPL port selected

jaen19:12:42

I run that

jaen19:12:49

It connects to the boot running in console

jaen19:12:57

I type (cljs-repl!) there

jaen19:12:00

And it just works

jaen19:12:17

Cursive recognizes it as a cljs REPL type automagically.

jaen19:12:22

Just make sure it does connect

jaen19:12:48

And you have a browser tab open on your cljs application

jaen19:12:57

Clojure 1.7.0
(cljs-repl!)
<< started Weasel server on ws://127.0.0.1:37381 >>
<< waiting for client to connect ... Connection is ws://localhost:37381
Writing boot_cljs_repl.cljs...
 connected! >>
To quit, type: :cljs/quit
=> nil

jaen19:12:08

Is how the Cursive REPL pane should look after connecting.

kenny19:12:37

You run the remote REPL first?

kenny19:12:53

If I run it first I just get

Error connecting to 127.0.0.1:37478 - class java.net.ConnectException: Connection refused

jaen19:12:59

Yes, I run it first.

jaen20:12:05

Hm, interesting.

kenny20:12:26

Nothing is running - no boot repl, or cljs build.

jaen20:12:15

One thing off the top of my head that might cause it is you have a wrong .nrepl-port file generated.

jaen20:12:30

Are you sure you are running only one REPL server?

jaen20:12:59

Errors like those happened to me if I ran something that overwrote the file

kenny20:12:00

Currently only java process is IntelliJ

jaen20:12:56

Hm, interesting. Can you pastebin your build.boot and printscreen your run configurations?

jaen20:12:03

I'm 100% positive this should work.

kenny20:12:48

I can do this: boot dev, boot repl -c, (cljs-repl) and I get a cljs-repl in the console but not in the REPL pane.

jaen20:12:59

Hm, honestly stumped, this looks good : |

jaen20:12:11

Another thing I remembered about such errors.

jaen20:12:25

Are you 100% positively sure you are running the same project in Intellij and in the terminal?

kenny20:12:55

Yes. I am using the terminal inside IntelliJ

jaen20:12:19

Hmpfh. Can you try a normal terminal just to be sure?

jaen20:12:42

I've never tried the one inside Intellij, so not sure if that may influence something.

kenny20:12:38

What URL do I connect to in the browser? When running boot dev it does not serve my project.

jaen20:12:18

Ah, right, then do copy over your serve task into the comp.

jaen20:12:27

I glossed over that, sorry.

kenny20:12:48

Stuck at:

started Weasel server on  >>
<< waiting for client to connect ... Connection is 
Writing boot_cljs_repl.cljs...

jaen20:12:22

Try reloading the tab

jaen20:12:45

That usually helps if it doesn't connect right away

kenny20:12:31

I can get the cljs repl in the console but it just wont connect in the REPL panel.

jaen20:12:59

Well, I suppose that's something to bring up in #C053K90BR; what I described always worked for me with boot+Cursive.

jaen20:12:15

I think boot hanging at Writing boot_cljs_repl.cljs... meant something, but can't remember what it was.

kenny20:12:28

Here is a screencast of what is happening: https://youtu.be/5rA_wP7PZEI

jaen20:12:52

@kenny: but it looks like it's working

jaen20:12:56

What's the problem?

kenny20:12:16

It is not a cljs repl in the cursive REPL panel.

jaen20:12:44

But you're not doing

jaen20:12:53

(start-repl) in Cursive REPL pane as well

jaen20:12:06

Only in the terminal

kenny20:12:54

Yeah that did it. Thank you! There should be better documentation on that simple_smile

jaen20:12:30

Hah, I suppose there could be. I don't remember it being that much of a problem to get it working for me, but I agree you have to figure it out looking at a few separate things, which is less than ideal.

jaen20:12:11

@kenny: by the by, I suggest you add

[org.clojure/clojure "1.7.0" :scope "provided"] ; or whichever version you're using
[org.clojure/clojurescript "1.7.170"]
should probably solve the version conflicts.

jaen20:12:23

I remember this might cause some problems

kenny20:12:01

Definitely got rid of some of them simple_smile

jaen20:12:41

Most of those are from clojurescript compiler; not sure about those that you have left, but it's usually a good idea to be clean of those if possible. I've had some code break due to that once.

jaen20:12:47

Anyway, glad the issue with REPL is solved.

kenny20:12:17

Same! They are all warnings and I haven't had a problem with them yet. Probably worth investing some time to figure them out though.