Fork me on GitHub
#cider
<
2022-04-22
>
bozhidar10:04:00

Fun story - seems we broke CIDER's trademark inspirational connection messages 4 years ago (https://github.com/clojure-emacs/cider/commit/5cb98a74bad81a2cd15f8db86c469020ed030156) and no one noticed this until recently, including me. 😄

cider 2
💯 4
👏 2
bozhidar10:04:29

Now it's fixed on master, and I even added a super hand interactive command named cider-inspire-me. 😉

Brandon Olivier15:04:15

Is there a way to get cider to indent Rum components in the same way that hiccup components are formatted? Or does everybody using Rum just accept the differences? Or not use auto formatting?

😀 1
magnars15:04:52

You are looking for define-clojure-indent

Brandon Olivier15:04:47

Is that possible to generate dynamically? I'd need to enumerate every Rum component, no?

magnars15:04:19

Dynamically from what source?

Brandon Olivier15:04:22

It just feels weird to me reading Rum code and seeing the base-hiccup and higher level rum components indented differently. Maybe I just need to get over it, but I'm used to reading just hiccup with Reagent and everything there is indented identically

magnars15:04:16

No, I agree with you. I certainly prefer the hiccup indentation (and syntax, but that's a different matter).

Brandon Olivier15:04:21

Seeing code formatted like this

(rum-component {:class ["foo"]}
                   [:div.flex.bg-base-100.gap-2.m-4.items-center
                    [:input.w-12.input.input-xs.input-primary]])
instead of
(rum-component {:class ["foo"]}
      [:div.flex.bg-base-100.gap-2.m-4.items-center
       [:input.w-12.input.input-xs.input-primary]])
seems weird.

magnars15:04:01

But in lieu of enumerating the components, where would clojure-mode find the symbols to indent differently?

magnars15:04:18

You could have emacs read the rum source code and populate it that way, perhaps?

Brandon Olivier15:04:53

I'm not sure, I wanted to ask before digging in too deep with my limited expertise.

Brandon Olivier15:04:07

Would it be possible to have Rum attach metadata to the functions to indent them differently?

magnars15:04:34

clojure-mode indentation is not dependent on a repl

Brandon Olivier16:04:05

Hmm. I guess I can just always put props on a newline. Then the indentation seems right to me.

magnars17:04:28

That is certainly a pragmatic solution.

lilactown17:04:54

that's what we do with #helix components

lilactown17:04:21

we have a style preference for props going on a newline when a child is passed in

lepistane19:04:38

Hello, I am using emacs and i am using deps.end for a project. This is my dev alias

{:extra-paths ["dev"]}
when i cider-jack-in i need to re-eval user namespace in order to run mount/start and to get project going. When i do clj -A:dev in that terminal repl i can (mount/start) right away. Why is this? How can i make cider-jack-in behave how i expect it to behave? This is the command cider-jack-in is using at the moment
/usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.7.0"} cider/cider-nrepl {:mvn/version "0.25.1"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
i don't want to have to edit it every time i run the project

Derek19:04:29

CIDER has a variable cider-clojure-cli-aliases. I often see this set in a .dir-locals.el file

lepistane19:04:31

Where do you put .dir-locals.el? In project folder?

Derek19:04:44

Yeah. Project root makes a lot of sense

practicalli-johnny22:04:27

Some example of using .dir-locals.el https://practical.li/spacemacs/clojure-projects/project-configuration.html Emacs will need to be forced to load .dir-locals.el if that file is added after a Clojure/Edn file is opened, using revert-buffer command (or reopen the Clojure/Edn file) before running the REPL command from that buffer Alternatively, usie the universal argument, C-u before calling cider-jack-in to get an editable command in the mini buffer

didibus05:04:38

I think Cider now also defaults the dev alias, so if you setup a :dev alias in your deps.edn, you can specify dev specific extras and jack-in should have them

practicalli-johnny10:04:02

I hope there is a Cider variable to disable the automatic loading of the dev alias I prefer to be explicit in the aliases I want loaded when running the REPL and may not want :dev always loaded, especially if I have broken something in dev/user.clj as that could stop the repl process starting.

didibus21:04:33

Oh, nevermind, I was wrong haha, forgot that I had added this to my config: (setq cider-clojure-cli-aliases ":dev")

practicalli-johnny09:04:49

Thanks for letting me know

Ian Fernandez20:04:59

why cider is sending :cider.enrich-classpath/found ,,,,, and :cider.enrich-classpath/omitting-empty-source and :cider.enrich-classpath/timed-out to nrepl buffer lots of these and taking too long to start? 😞

vemv13:04:39

enrich-classpath is disabled by default these days, make sure you're using CIDER latest stable

👍 1