weavejester / cljfmt

A tool for formatting Clojure code
Eclipse Public License 1.0
1.11k stars 120 forks source link

Indenting defrecord like CIDER #221

Open bsless opened 3 years ago

bsless commented 3 years ago

Hello, Is there a way to mimic CIDER's indentation of defrecord's arg vector using the existing configuration mechanism? I read the documentation and I'm not sure it's possible. For comparison:

;;; Emacs
(defrecord Foo
    [a b])

;;; cljfmt
(defrecord Foo
           [a b])

Thanks, Ben

lread commented 3 years ago

@bsless I don't currently have an answer for you but I think there is some related discussion in this old issue.

bsless commented 3 years ago

@lread Looks like it is indeed related. The "weird" behavior is specified here clojure-mode lets the user tell the indentation mechanism some forms have N special form arguments. Special forms then have a predefined indentation level. Think something similar could be added as a feature?