-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent indentation for custom threading macros #3684
Comments
Thanks, I'll check. |
The bug is that one should be able to specify Most likely we conflate "nothing was specified at all" with " I'll try to fix this in the first half of the week, please do ping us if that doesn't happen. (PR also welcome for anyone wanting to grab it) |
Friendly ping 😄 No hurry, though. I'll also try to look into it using your hint when I find some spare cycles again. But that might be a while. |
You can check out clojure-emacs/cider-nrepl@7fdca13 and run:
Change, if needed, 0.49.0 to whatever version of cider-nrepl you normally use. Then, adding LMK how it goes - thanks! |
Thanks!
Where would I add that? To the macro's metadata? If so, then this won't do the trick for third-party macros, e.g. |
(Unless they are willing to include it upstream, that is) |
Yes. You can After we conclude it works, I can PR it myself in case a generous explanation helps th change making it in. |
Expected behavior
Custom threading macros (like the ones found in
promesa
) should be indented like the ones fromclojure.core
when operands are given in separate lines, i.e. they should line up vertically like so:Actual behavior
Instead, CIDER indents such custom macros like a macro with a "head" form (e.g. like
doto
):This might be a regression of the fix introduced for #3490.
Steps to reproduce the problem
promesa
)M-x cider-jack-in
from the project root and select theclojure-cli
commandsrc/repro/core.clj
and re-indent themain
function in therep/ok->>
form will be indented likeclojure.core/->>
but thep/not-ok->>
form won't. If you look at their definitions insrc/repro/p.cljc
you can see that the only difference is thatnot-ok->>
has a standalone first argument whileok->>
doesn't. This also happens when renamingnot-ok->>
to just->>
(as is the case inpromesa
).This also happens with ClojureScript which can be tested by
M-x cider-jack-in-cljs
and selecting the:main
build.Environment & Version information
CIDER version information
Lein / Clojure CLI version
Clojure CLI version 1.11.3.1463
Emacs version
GNU Emacs 29.3 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.18.0, Xaw3d scroll bars)
Operating system
NixOS 24.05
JDK distribution
OpenJDK
The text was updated successfully, but these errors were encountered: