Fork me on GitHub
Joshua Suskalo00:07:02

cider-eval-defun-at-point might get what you want.


There’s an equivalent to insert. That command will just evil


Let me finish dinner and I’ll show you my tweaks


@deleted-user do you use use-package?


(setq cider-invert-insert-eval-p t)
  (setq cider-switch-to-repl-after-insert-p nil)
  (setq cider-switch-to-repl-on-insert-p nil)


so there's a a cider-insert-map under C-c C-j


which has insert region(r), defun (d), and expression (e)


but it puts focus in the repl which is annoying which is the purpose of the 2nd (and 3rd there. there was a refactor so depending on your CIDER version one of the other is correct)


oh and this: (setq clojure-toplevel-inside-comment-form t) which lets you work with top level things inside of (comment ,,,) forms


cool. use that one instead


yeah. someone mentioned "on" is ambiguous so now its "after"


ah yeah. forgot i put that in there.


can't muck with the definition of what is a top level thing without lots of user testing


Hey guys, I’ve been playing with shadow-cljs and CIDER I don’t think it’s working as I wanted. Can someone point me to a minimal, up to date example of node-js build with CIDER instructions please. Documentation is confusing, some sources say you need to npm install source-map-support and ws, shadow-cljs manual says nothing of that sort, trying to jack-in-cljs prompts me with questions multiple times and then says something like

[:no-worker :dev]WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)shadow.user> 
I basically want to cider-jack-in and see printed statements in the REPL when app starts and when I update the code i.e: (`:after-load`). I was able to run shadow-cljs watch dev in one terminal window and then node target/app.js in another, but I just want to cider-jack-in and chill.


Honestly, I think Clojurescript REPL driven workflow right now is such a mess. I’ve been writing Clojure for 3 years, and I still can’t figure this out easily, how newbies suppose to deal with this shit I have no idea. Like having a bunch of options wasn’t enough: lein, deps, figwheel, figwheel-main, boot, shadow in browser, shadow in node, with webpack, without it, etc. etc.


and somehow we’re like “yeah, Clojurescript is awesome, I wish more people used it”. Yeah, I think more people would’ve used it if it wasn’t so damn confusing.


it's hard to get started, but once it's going, i find it even better than with clojure itself (the workflow)


save the file, see the result instantly, no need to fiddle with the repl... and test results pop a system notification while you look at the app


okay, I was able to finally jack-in and I see cljs.user> prompt, but when I change the code my :devtools {:after-load server/reload!} which has only one line (println "Code updated...") is nowhere to be seen. It looks like it’s recompiling, but where is it printing this stuff?


that would depend on your setup


maybe in the browser console ?


I don’t want browser console. I need simple, vanilla nodejs


I’m trying (:require [cljs.nodejs :as node]) and (node/enable-util-print!) and still not working


i can't help with that, no experience at all with node


better ask in clojurescript channel


Admittedly our ClojureScript documentation is pretty basic ( and contributions to it would be most welcome.


Can you toss out the refactor nrepl dep? There is no project.edn and it sounds like it’s a bit lost

Nick Stares14:07:31

using shadow-cljs, when I cider-connect to the repl process, I get

WARNING: No Clojure project was detected. The
refactor-nrepl middleware was not enabled. (You can mute this
warning by customizing `cljr-suppress-no-project-warning'.)
In the repl window, and calling cider-switch-to-repl-buffer I get no cljs REPLs in current session


the first is saying clj refactor doesn't speak shadow and it won't do anything. For the second, is the cljs repl connected?

Nick Stares14:07:46

I have a working shadow-cljs repl buffer in emacs that's connected to the shadow-clj watch app repl process


put the point in that buffer and then back into the source buffer. should be good after that

👍 4
Nick Stares15:07:19

hmm, that did the trick, but now I'm getting No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code. when I eval a sexp


I get this when I am running a web app and haven’t connected my browser to the shadow-cljs server, could that be the case for you?

Nick Stares15:07:21

new error = progress


have you connected the browser to the app?

Nick Stares15:07:07

Aha! That was it. Didn't realize that was part of the process. First time using shadow-cljs 🙂

👏 4