Fork me on GitHub
#cider
<
2018-02-06
>
xiongtx01:02:51

@bozhidar @cichli How can we evaluate some code in the cljs buffer from within CIDER? Seems like that’d be the easiest way to fix https://github.com/clojure-emacs/cider/issues/2099.

bozhidar02:02:29

Looking at your research and the question I’m a bit confused - isn’t the problem that the wrong thing is passed to macroexpand?

xiongtx02:02:49

I’ve no idea how to get the “right thing”. So the easiest thing to do seems to be to evaluate the macroexpand form in the cljs context and grab the result.

xiongtx02:02:17

B/c we know that calling macroexpand in the cljs REPL does the right thing

bozhidar02:02:18

A source buffer with a cljs connection would yield the same eval results.

bozhidar02:02:51

The only difference is that for REPLs the connection type is always static, but for other buffers it’s inferred dynamically.

xiongtx02:02:20

I don’t understand. Clearly there is some context for cljs that is not there for clj. Maybe some dynamic vars need to be bound? What I mean is that there’s no need to call cljs.analyzer/macroexpand-1. cljs.core/macroexpand-1 should work, if we provide the right context.

bozhidar09:02:24

Probably you’re right, but keep in mind that in the middleware everything is Java code and that’s why everything we can do there is just use the cljs compiler state. That’s also how completion is implemented for Cljs. I’m not sure how we can evaluate real ClojureScript code there. Maybe looking to piggieback’s code would be informative?

bozhidar02:02:21

For the evaluation - what we always do is to leverage piggieback in the underlying nREPL connection + whatever cljs REPL the user decide to start on top of it.

xiongtx11:02:09

@bozhidar @cemerick Had some thoughts on CLJ-1146 and clojure-emacs/cider#1372: https://github.com/clojure-emacs/cider/issues/1372#issuecomment-363392344 I'd ❤️ to get this fixed. The Unmatched delimited: ) message has driven me up the wall a few times.

bozhidar12:02:13

Yeah, seems to me this can be fixed in nREPL, but I guess it should happen after the compatibility 0.3 release we’re waiting for right now.

xiongtx21:02:34

Anything that can be done in cider-nrepl? Or does it have to be nREPL itself?

bozhidar12:02:17

Once https://github.com/cemerick/nREPL/issues/1 is done we can finally start hacking freely on nREPL and make some awesome improvements.

pablore18:02:32

How can I connect figwheel repl to cider’s. Google search only gives me paid clojure courses as results

pablore19:02:59

@emoarmy thanks