Fork me on GitHub
#cider
<
2021-04-11
>
yuhan04:04:35

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

👍 4
wcalderipe15:04:38

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)

dpsutton15:04:28

so there seems to be an issue going on:

dpsutton15:04:55

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

dpsutton15:04:06

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

dpsutton15:04:23

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

dpsutton15:04:13

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

dpsutton15:04:24

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

dpsutton15:04:55

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

👍 3
wcalderipe18:04:34

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

cider 3
wcalderipe18:04:22

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

wcalderipe18:04:52

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

dpsutton18:04:12

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

dpsutton18:04:46

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

wcalderipe18:04:12

thanks again

nikolavojicic18:04:38

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?

bozhidar08:04:25

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

nikolavojicic08:04:17

Yes, when using Clojure everything is highlighted correctly.

vemv10:07:45

I believe this will be fixed with the next cider release (tech details: https://github.com/clojure-emacs/cider-nrepl/pull/785) Feel free to try cider-nrepl 0.32.0 by setting it in your shadow-cljs.edn or by customizing Emacs cider-injected-middleware-version . (if you see a repl warning about a version mismatch, it's safe to ignore)

nikolavojicic21:07:50

I upgraded cider-nrepl to that version but it still doesn't highlight core fns. 🥺

nikolavojicic22:07:03

I will create issue with more details.

👍 2
vemv04:07:27

Looking forward. Looking at your picture, there's a chance that everything's ok? I see clojure macros in pink, and clojure functions in black, while dispatch-async also is in black. clojure.core functions don't have anything special that would make them deserve a different syntax coloring? At least that has been my impression using cider over the years

nikolavojicic09:07:35

Core fns should be blue, same as current-page.