This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-03-24
Channels
- # announcements (31)
- # babashka (21)
- # babashka-sci-dev (4)
- # beginners (8)
- # cherry (4)
- # cider (32)
- # clj-kondo (15)
- # cljdoc (4)
- # cljsrn (4)
- # clojure (69)
- # clojure-dev (1)
- # clojure-europe (12)
- # clojure-nl (1)
- # clojure-norway (8)
- # clojure-uk (4)
- # clojurescript (16)
- # clr (6)
- # conjure (4)
- # fulcro (4)
- # hispano (1)
- # honeysql (1)
- # humbleui (5)
- # hyperfiddle (8)
- # lambdaisland (4)
- # lsp (8)
- # malli (24)
- # off-topic (3)
- # polylith (5)
- # reagent (10)
- # remote-jobs (3)
- # rewrite-clj (7)
- # scittle (12)
- # spacemacs (4)
- # sql (2)
- # tools-deps (29)
- # xtdb (7)
I would love to see some examples of Emacs code that's interacting with cider for project management purposes or really any reason at all. It will help me get a sense of how things can or do fit together. No need to explain it, just drop links, i tried searching Google and failed hard to find examples.
https://practical.li/clojure/data-inspector/portal/#editor-nrepl-middleware Portal uses nrepl from Emacs commands, see the Emacs configuration part for example code, e.g.
;; def portal to the dev namespace to allow dereferencing via @dev/portal
(defun portal.api/open ()
(interactive)
(cider-nrepl-sync-request:eval
"(do (ns dev) (def portal ((requiring-resolve 'portal.api/open))) (add-tap (requiring-resolve 'portal.api/submit)))"))
I use some emacs -> cider code This snippet let's me restart my integrant system from with just a hotkey.
(defun cider-reset ()
(interactive)
(cider-interactive-eval "(require 'dev)(dev/reset)"))
(global-set-key (kbd "C-x C-j") 'cider-reset)
This snippet lets me start a bunch of repls up at once:
(defun cider-init ()
(interactive)
(find-file "~/a/project.clj")
(call-interactively 'cider-jack-in)
(find-file "~/b/project.clj")
(call-interactively 'cider-jack-in)
(find-file "~/c/project.clj")
(call-interactively 'cider-jack-in-cljs))
(global-set-key (kbd "C-x C-y") 'cider-init)
thanks @UJVEQPAKS!
Hi there! I'm trying to working with cljs repl and clj (deps.edn and shadow). I found that there is cider-merge-sessions variable. How I can use this, can't find any doc.
When I want to start a repl in a remote machine, I issue:
$ /nix/store/yv4mc9dn4bs6hb4h6lsq345dnpgrv0xg-clojure-1.11.1.1224/bin/clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "1.0.0"} cider/cider-nrepl {:mvn/version "0.30.0"} refactor-nrepl/refactor-nrepl {:mvn/version "3.6.0"}} :aliases {:cider/nrepl {:main-opts ["-m" "nrepl.cmdline" "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}}}' -M:cider/nrepl
Is there a way to specify a particular port instead of getting a random one?Found it, I have to create an .nrepl.edn
file with content:
{:bind "localhost"
:port 12345}
Yesterday I released CIDER 1.7 (https://github.com/clojure-emacs/cider/releases/tag/v1.7.0), but I forgot to announce it. Enjoy!
autocompleting lexical bindings in cljs is a great addition -- looking forward to using it today 😁
What is cider-jack-in-dependencies
used for?
I haven't been able to find anything in the cider docs.
I assume it's different to cider-clojure-cli-aliases
cider-jack-in-dependencies is a variable defined in 'cider.el'.
Its value is (("nrepl/nrepl" "0.9.0"))
List of dependencies where elements are lists of artifact name and version.
More broadly it's for adding stuff necessary for cider itself to work, e.g. cider-nrepl, refactor-nrepl (if using clj-refactor), piggieback (if using cljs), enrich-classpath (disabled by default)
When using CIDER with a cljs REPL, my namespace keeps getting reset to cljs.user. Does it ring a bell? I found a very old issue describing the problem, but apprently it's been fixed years ago. https://github.com/nrepl/piggieback/issues/33
This only happens when I set the namespace using cider-repl-set-ns
(via C-c M-n M-n
)
Manually selecting it (ns my.ns)
will make it stay
Here's how it looks when it automatically switches back to cljs.user
:
my.ns> (+ 1 1)
2
cljs.user>
I'm unable to reproduce this issue with CIDER 1.7.0 and shadow-cljs 2.22.2 running on Emacs 28.2
CIDER 1.7.0 Emacs 28.2 figwheel-sidecar 0.5.20
Actually, are you using figwheel or figwheel-main? IIRC figwheel-sidecar is a middleware for the former, and figwheel has been deprecated in favor of figwheel-main I think
Figwheel, the project only requires sporadic maintenance and wasn't worth the migration.
And if the problem is not with figwheel and I do migrate, I'll be a sad panda 😞
Doesn’t hurt to make an empty folder, npx shadow-cljs init
, then M-x cider-jack-in-cljs
😉
> cider--update-jack-in-cmd: The npx shadow-cljs executable isn’t on your ‘exec-path’
Hmmm...
I installed it with npm install -g shadow-cljs