This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-05-13
Channels
- # announcements (1)
- # babashka (2)
- # biff (10)
- # cider (11)
- # clara (17)
- # clerk (10)
- # clojure (21)
- # clojure-berlin (4)
- # clojure-brasil (1)
- # clojure-europe (32)
- # clojure-nl (1)
- # clojure-norway (18)
- # clojure-uk (10)
- # cursive (2)
- # data-science (11)
- # datomic (10)
- # emacs (8)
- # events (7)
- # fulcro (29)
- # gratitude (2)
- # honeysql (21)
- # hyperfiddle (7)
- # lsp (2)
- # malli (4)
- # polylith (4)
- # reitit (8)
- # releases (1)
- # shadow-cljs (15)
- # squint (3)
- # xtdb (5)
How do I test style/indent meta? I feel I keep changing it but when I format it always formats the same way
M:- (put-clojure-indent 'let-404 0)
where 0
is an indent spec (CIDER indent spec matches clojure-mode's 1:1)
then emacs just knows how to indent let-404
and it will work in all related functions (e.g. indent-for-tab-command
)
So I always have to explicitly configure each function? Can't cider/clojure-mode automatically pick up the meta?
You asked about how to test it :) put-clojure-indent
is a sure-fire means of testing the effect of a particular choice
CIDER is responsible of picking up :style/indent
and dynamically building clojure-mode indents out of them
It can also infer indents in selected cases https://docs.cider.mx/cider/indent_spec.html#indentation-inference
Ya I did. I guess my follow up question is if cider is supposed to pick it up automatically? And why it's not in this case? Does it need some cache deleted, or do I have to restart the repl, etc.
Code has to be evaled, since code insights are runtime-powered. You can re-eval a defmacro and its indents will be refreshed, if they changed Other than that it should work - if it doesn't, issue welcome
Hum... I'm wondering two things: 1. Could inference overrule my meta? 2. Could clojure-lsp mess with indent rules?
Ok, it does seem it has something to do with indent inference. If I rename it to something very dif different it works.
So ya, even put-clojure-indent
doesn't work in my case.