cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
yuhan 2021-04-11T04:31:35.227500Z

I got recur working with eldoc correctly 🙂 Here's the code if anyone wants to try it out: https://gist.github.com/yuhan0/21dca369afb8c7537554ce86b42b55b7 I'll use it for a while before making a PR, there's a couple of while loops in there that I'm not entirely certain won't lock up in an infinite loop

👍 1
wcalderipe 2021-04-11T15:25:38.229300Z

hey folks 👋 I'm having issues with cider-connect-cljs on a shadow-cljs project. I'm not sure this is the right channel to post my question, but I'm in the hope that someone else here would have faced the same issue before and will point me in the right direction or just say the right channel :) I noticed that when I connect Emacs to a running nrepl using cider-connect-cljs, my REPL doesn't work the same way as it does when I use cider-jack-in-cljs for instance. To be honest, I don't know if cider-connect-cljs and cider-jack-in-cljs have different user experiences but I assume they don't. I have recorded a video to try to explain the problem a bit better. What you can see is: - Run shadow-cljs watch to have the app and a REPL running - Use cider-connect-cljs to connect Emacs on the running REPL - Try to execute some fn like cider-repl-set-ns, cider-eval-last-sexp, and cider-load-file but none seem to have any effect - Use in-ns to check if the REPL is connected to the right project and working The project you see on the video is here https://github.com/wcalderipe/cljs-playground (there's nothing special). Versions: macOS Big Sur 11.2.2 Emacs 27.1 Cider latest commit on master (I'm using straight.el)

dpsutton 2021-04-11T15:47:28.229700Z

so there seems to be an issue going on:

dpsutton 2021-04-11T15:47:55.230100Z

CIDER thinks that it is not connected. note the "pending-cljs". As far as CIDER is concerned, there is a clj repl that is in the process of becoming a cljs repl

dpsutton 2021-04-11T15:48:06.230300Z

(do (require '[shadow.cljs.devtools.api :as shadow])
    (shadow/nrepl-select :hexagonal))

dpsutton 2021-04-11T15:48:23.230500Z

this is what CIDER runs when you connect. it require shadow's stuff and then nrepl-select's the build

dpsutton 2021-04-11T15:56:13.230700Z

and it seems that you need CIDER's middleware present for CIDER to be aware that the cljs repl is ready

dpsutton 2021-04-11T15:57:24.230900Z

if you add it to the startup command shadow-cljs -d cider/cider-nrepl:0.25.9 watch hexagonal or just cider-jack-in-cljs it will work

dpsutton 2021-04-11T15:57:55.231100Z

when diagnosing this stuff i always try to do it by letting CIDER jack in, seeing what commands and dependencies it puts in place and then ensuring that the manually set way does the same

👍 1
wcalderipe 2021-04-11T18:03:34.231300Z

hey @dpsutton the -d cider/cider-nrep:0.25.9 worked like a charm. thanks so much for sharing the solution and the rationale behind it!

1
wcalderipe 2021-04-11T18:22:22.233300Z

I wonder if I can do that without the --dependency option :thinking_face:

wcalderipe 2021-04-11T18:22:52.233900Z

(and outside the dependencies of the project, since not everybody uses Emacs)

dpsutton 2021-04-11T18:25:12.235700Z

i don't know of any way to dependently put it in there besides the command line

nikolavojicic 2021-04-11T18:25:38.236200Z

cider + shadow-cljs REPL does not highlight core functions... (Functions defined in current namespace are highlighted properly) Is that current behavior or I configured something wrongly?

bozhidar 2021-04-12T08:00:25.242Z

Are the core functions highlighted correctly when using Clojure instead of ClojureScript? I want to narrow this down to configuration vs track-state.

nikolavojicic 2021-04-12T08:21:17.244Z

Yes, when using Clojure everything is highlighted correctly.

dpsutton 2021-04-11T18:25:46.236300Z

i think it would be fine to put it in there and the people who don't use cider wouldn't even notice it

wcalderipe 2021-04-11T18:39:10.236700Z

agree 🙂

wcalderipe 2021-04-11T18:39:12.236900Z

thanks again