This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-18
Channels
- # announcements (6)
- # aws (1)
- # babashka (47)
- # beginners (50)
- # calva (65)
- # cider (4)
- # clj-commons (17)
- # clj-kondo (44)
- # clojure (150)
- # clojure-europe (41)
- # clojure-nl (4)
- # clojure-spec (1)
- # clojure-sweden (4)
- # clojure-uk (6)
- # clojurescript (15)
- # clr (1)
- # conjure (1)
- # core-async (7)
- # cursive (5)
- # datomic (12)
- # events (2)
- # fulcro (17)
- # graphql (12)
- # introduce-yourself (1)
- # jackdaw (5)
- # jobs (2)
- # lsp (52)
- # malli (5)
- # meander (3)
- # minecraft (2)
- # missionary (2)
- # off-topic (10)
- # other-languages (9)
- # reitit (9)
- # remote-jobs (1)
- # ring (8)
- # rum (7)
- # shadow-cljs (9)
- # sql (2)
- # tools-deps (20)
- # xtdb (12)
when running cider-jack-in-clj
(or -cljs
), cider asks me which command should be used. In our project, with clj
the answer is lein
and with cljs
its shadow-cljs
. Is it possible to configure this automatically with e.g. .dir-locals.el
? I tried browsing through the cider variables, but didn't find anything suitable.
this both exists and doesn’t exist. What exists is a var called cider-preferred-build-tool
. Using .dir-locals
, you can make this var have lein
when in clojure-mode
and shadow
when in clojurescript
mode. But this leaves ambiguity when in an edn buffer like shadow-cljs.edn
annoyingly. And even more annoyingly, it (currently) isn’t configured by cider-jack-in-clj
and cider-jack-in-cljs
which it should. So the answer is “kinda” and open to improvements. You could also make little functions like work-clj-repl
and work-cljs-repl
that call cider-jack-in
with the correct vars passed in
Based on my very minimal emacs experience I assume the first trick you mentioned requires that I must be in a cljs buffer to start the cljs repl and vice versa with clj? I guess creating custom functions is a better choice, that way I can call them regardless of the buffer type I assume
correct about the buffer types. you can set dir-locals that work in all modes, and you can set values for each type of mode you are in. But yeah it would require being in a cljs buffer when you start up your repl. and forgetting that makes a long and annoying mistake. I’d for sure go with functions