Fork me on GitHub

@qythium Looks reasonable to me. I don’t use/like spec, so improving the support for it has never been a priority for me.


How can I set the port for cider-connect-sibling-cljs? I have already run cider-jack-in-clj and need to connect to an already running cljs repl. However, cider-connect-sibling-cljs refuses to use anything other than the same port number as the clj repl. Editing .nrepl-port was no help. And C-u also seems to have no effet


@tvaughan The sibling REPL is supposed to be on the same nREPL server by definition. That’s why you can’t specify this manually.


Keep in mind that in nREPL a single physical connection can host multiple logical connections (nREPL sessions).


From the perspective of CIDER the cljs connection is just a different nREPL session.


Therefore the sibling terminology - they run side-by-side on the same server.


OK. I've misunderstood then. How do I run cider-jack-in-clj and connect to an already running cljs repl? I've tried other approaches and I always seem to lose the clj repl.


i connect to a running cljs project separate from my clj backend like so for work:


(defun aclaimant-jack-in-dashboard ()
    (cider-connect-cljs (list :host "localhost"
                              :port 7888
                              :cljs-repl-type 'figwheel-connected
                              'project-dir "~/projects/aclaimant/acl")))


i also have a shadow-cljs project here. I threw in a deps.edn file and started a clojure repl. Then shadow-cljs watch app from the command line, m-x cider-connect-cljs selected localhost, then the port for shadow and i'm up and running. I'm not seeing any issue to this workflow? Did i miss something?


@U11BV7MTK This is exactly what I did. But after cider connects to the cljs repl I lose the clj repl. I can no longer evaluate clojure expressions/buffers


oh. i didn't test that. sorry. let me check


hmm, i'm not having any such issues


but need to mention that there is a limitation that CIDER isn't aware of clj versus cljs repls in the same project. its only aware of the last repl


so if you need to evaluate clojure, the last repl to have focus needs to be your clojure repl, and if you need to evaluate cljs, the last repl to have focus needs to be your cljs repl


basically it asks of all the connections for the latest repl, and if its a clojure one, it thinks you don't have a cljs repl at all so things appear disconnected


Actually, the problem is that when you do two separate connections you end up with independent sesman sessions, that have just one connection each.


How do you "focus" the clojure repl?


put the point in it

👍 4

@U051BLM8F ah thanks. i've never really gotten deep into sesman. but i think the observed behavior here is the same regardless. That api needs to be opened up for us so we can track the "latest" clj and latest cljs repls


I wonder if any other projects have used sesman?


from this it seems like just CIDER at the moment


Hmmm I can't focus the cljs repl. I can evaluate expressions in each repl directly, however, evaluating something like (js/console.log "Hi") in a .cljs file is sent to the clj repl


Not our finest writing, but I think it gives a good overview of session/connection management.


Yes. Especially this The current REPL is the most relevant REPL from the current session. REPL relevance is determined by the type of the current buffer.


C-c C-s i only lists the clj repl session


C-c C-s w lists two but the cljs session is linked to a directory path that's totally wrong


I'll start over... Thanks for everyone's help!


OK. It's working now. I don't know why it wasn't working. I think maybe it was because I connected to the cljs repl first using cider and then in a browser. It seems to only work if I connect to the cljs in a browser first and then using cider. I don't have to focus the repl either. Cider chooses the correct repl correctly based on the current buffer type


curious, why does cider have 3-4 different keybindings for the same command for many commands?


you can see them in C-h m - cider-eval-last-sexp has three for example


C-x C-e C-c C-e C-c C-v e


i have

C-c C-e         cider-eval-last-sexp
C-c C-f         cider-pprint-eval-defun-at-point
C-c C-j         cider-insert-commands-map
C-c C-k         cider-load-buffer


yep, if you keep going down you'll see some of those have additional bindings


ah i see! missed it


triples your chance of guessing right harold