Fork me on GitHub
#cider
<
2016-11-17
>
danielstockton08:11:10

@jasonjckn I was looking for similar, gave up in the end. It seems the standard approach is to cider-clojurescript-jack-in. If you are trying to run fighweel or something, you can run it from the jacked in repl.

mitchelkuijpers11:11:37

Does anyone know if the code that uses the var indentatino metadata is a lib that I could use?

kasuko16:11:59

@jasonjckn As far as I can tell that isn’t possible. The way clojure allows you to connect is using an NREPL connection. A clojurescript repl doesn’t provide an NREPL connection. The way cider-clojurescript-jack-in works is starting a clojure repl with NREPL support and then uses cemerick/piggieback to turn that clojure repl into a clojurescript repl.

mahinshaw17:11:02

@jasonjckn Take a look at cider-cljs-lein-repl. It is a var the tells cider what to run when calling cider-clojurescript-jack-in. I use it from a dir-locals.el file to call (start-figwheel) which lives in my user ns. You can sub that out for whatever function lives in the :init-ns you have in your project.clj

jasonjckn17:11:39

@mahinshaw but how do you get two different REPL buffers?

jasonjckn17:11:12

@mahinshaw i'm aware of figwheel repl-api, but not sure how to take a CLJ repl buffer, and create a CLJS repl buffer, and also have CLJS files evaluate in that repl, and CLJ files evaluate in the other

mahinshaw17:11:22

That is given to you when you call cider-clojurescript-jack-in

jasonjckn17:11:36

i'm trying to do cider-connect

mahinshaw17:11:20

If you are using figwheel, the repl buffer wont exist until the websocket is connected to your cljs app. This is a figwheel thing

mahinshaw17:11:13

If you are using cider connect, you should just be able to start your figwheel repl and wait for it to connect. once that is done, the cider-repl-type should output cljs

mahinshaw17:11:51

If you use the afformentioned workflow, cider-clojurescript-jack-in, will create two buffers from one repl instance. A clj one, and a cljs one

mahinshaw17:11:36

When you are in cljs code, cider-switch-to-repl-buffer will open up the proper repl based on the type

jasonjckn17:11:15

right, yah my question is connecting to a repl server and spawning cljs/clj setup

jasonjckn17:11:21

not jack-in into localhost

mahinshaw17:11:22

In that case, I don’t know that cider provides you with an easy way to create more than one buffer. I would just connect twice, and in one start a cljs repl

mahinshaw17:11:12

Cider will just prompt you and ask if you want to start a new connection, for which you say yes. There is also a way to name them. I used to use two repls, and then moved to the aformentioned workflow

jasonjckn17:11:35

yah that would work, albeit it wouldn't send cljs code to CLJS repl automatically, etc

mahinshaw17:11:09

If the cljs repl is connected properly

mahinshaw17:11:25

not saying your doing it wrong, I’m just surprised

jasonjckn17:11:39

you're saying call cider-connect twice? right

jasonjckn17:11:55

i'll try it out, I presumed that it has no logic to detect which one is the CLJS repl buffer

mahinshaw17:11:16

It does. Look at the var cider-repl-type

mahinshaw17:11:31

You can actually set it manually, which can be annoying, but it works

mahinshaw17:11:01

I would connect, and get a cljs repl started, make sure the type is right, and then connect again, and use the second as my clj repl

danielstockton20:11:46

I use cider-cljs-lein-repl to start figwheel when i do cider-clojurescript-jack-in, i end up with two repl buffers...

danielstockton20:11:07

It will choose correctly which one to send code to, depending on the file extension