lilactown / helix

A simple, easy to use library for React development in ClojureScript.
Eclipse Public License 2.0
624 stars 52 forks source link

Fix indentation with CIDER #146

Closed lilactown closed 10 months ago

lilactown commented 11 months ago

Current version of cider infers the indentation of the $ macro to be wrong since version 0.32. https://docs.cider.mx/cider/indent_spec.html#indentation-inference

The fix would be to specify the correct indentation level.

rome-user commented 11 months ago

While we're at it, I think it would be useful to introduce :style/indent metadata on each macro Helix exposes. I did some work a month ago to do this for the helix.dom macros. The good news is that both CIDER and Calva will recognize this metadata. I am not sure if Cursive supports it, though.

https://github.com/weavejester/cljfmt/issues/49#issuecomment-812601209 offers inspiration for maintaining a set of cljfmt metadata. (Again, I am not sure if Cursive supports cljfmt, but CIDER and Calva support cljfmt integration).

lilactown commented 11 months ago

for Cursive, it relies a lot more on static analysis. I'm tempted to get rid of the gen-tag macro and have them all written out in the file, tbh

vemv commented 10 months ago

FYI, cider-nrepl 0.39.0 has been released with refined indentation inference. In practice, it means that defnc is no longer inferred. $ is, and remains needing explicit :style/indent metadata.

cider-nrepl 0.39.0 is injected by CIDER latest (Git master, or the MELPA snapshot that will be visible within a couple hours).