Fork me on GitHub

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


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


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


@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


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


@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


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


i'm trying to do cider-connect


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


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


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


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


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


not jack-in into localhost


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


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


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


If the cljs repl is connected properly


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


you're saying call cider-connect twice? right


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


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


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


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


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


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