Fork me on GitHub
#cider
<
2020-06-22
>
rschmukler14:06:11

Hey all! does anybody know if there's a variable / way to have cider in a cljc file only send to one side (ie. I want to evaluate a sexp in just CLJS, or in just CLJ)

dpsutton14:06:20

i believe it should evaluate in the buffer that was most recently focused. so put point in the cljs repl, then back in the cljc ile and should be good

rschmukler15:06:40

The behavior I seem to have is it evaluating in both buffers

dpsutton15:06:26

oh right. i think you can change the mode to clojurescript mode with m-x clojurescript-mode and it shoudl behave as you want

rschmukler15:06:26

Oh, that makes sense!

rschmukler15:06:06

Thanks for the help

ramblurr15:06:34

I'm having a helluva time getting cider working with shadow-cljs. I'm fairly certain its a cider/config issue and not a shadow-cljs issue. The docs at https://docs.cider.mx/cider/cljs/shadow-cljs.html say "Provided you’ve configured your project correctly, you can simply use cider-jack-in-cljs " ... yet I can't find a correct configuration.

dpsutton15:06:50

configuration for what?

ramblurr15:06:00

Starting with a fresh shadow-cljs project, I can connect cider to the node-repl, and eval forms in the repl prompt. I can also use cider-eval-last-sexp to eval forms, however cider-eval-buffer doesn't seem to actually eval anything.

dpsutton15:06:03

also, are you using lein or deps for dependencies?

ramblurr15:06:38

for deps i'm using shadow-cljs', shadow-cljs.edn

rschmukler15:06:15

Make sure you have:

:nrepl    {:middleware [cider-nrepl.plugin/middleware
                         refactor-nrepl.middleware/wrap-refactor]}
In your shadow-cljs.edn

ramblurr15:06:50

Ah, ok, that's definitely missing.

dpsutton15:06:03

cider-jack-in-cljs will add its needed dependencies

rschmukler15:06:48

I've run into issues in the past where it adds the deps, but doesn't actually load the middleware in shadow's nrepl. That may be fixed, this was as of a few months ago

rschmukler15:06:16

(But worth trying just to see if that gets it going)

dpsutton15:06:26

that's when you are using lein/deps for dependencies

rschmukler15:06:47

Ah, you're right - I am using deps.edn

ramblurr15:06:02

is it just an oversight that thats not added to the docs at https://docs.cider.mx/cider/cljs/shadow-cljs.html ?

ramblurr15:06:24

I thought it was strange that it stated Provided you've configured your project correctly but then never provided a configuration, just some commands on how to connect.

dpsutton15:06:16

can you post your shadow-cljs.edn file?

ramblurr15:06:50

{:source-paths ["src/dev" "src/main" "src/test"] :dependencies [] :nrepl {:middleware [cider-nrepl.plugin/middleware refactor-nrepl.middleware/wrap-refactor]} :builds {}}

dpsutton15:06:22

you can get rid of the middleware key. i'm surprised to see no builds there though

ramblurr15:06:24

Er, when I first showed up it didn't have the :nrepl bit

ramblurr15:06:36

this is just a basic test project using the node-repl

ramblurr15:06:13

Hm, something has broken, I can't get it working with or without the :nrepl key. Posting a test project to github..

dpsutton16:06:20

@ramblurr got a link?

ramblurr16:06:17

Got pulled away, will finish it up in a bit

ramblurr17:06:10

How does the shadow-select option differ from the normal shadow one?