cider-nrepl
cider-nrepl copied to clipboard
Observe .cljfmt.edn files
Soft of a draft, does it look good to you? @yuhan0 @bbatsov
Before submitting a PR make sure the following things have been done:
- [ ] The commits are consistent with our contribution guidelines
- [ ] You've added tests to cover your change(s)
- [ ] All tests are passing
- [ ] The new code is not generating reflection warnings
- [ ] You've updated the README (if adding/changing middleware)
Note: If you're just starting out to hack on cider-nrepl
you might find
nREPL's documentation and the
"Design" section of the README extremely useful.*
Thanks!
Also just wondering if this should be designed in mind for extensibility to other formatting backends in the future, similar to the pprint middleware - eg. the more opinionated zprint
or a hypothetical "Tonsky formatter".
Zprint for instance already recognizes its own .zprintrc files, so passing an additional key for config-file could be confusing.
I agree that it'd be better to support both zprint and cljfmt as formatting backends, but I don't feel strongly about this.
Sorry that I had completely forgotten about this PR!
Me too :) will get back at it soon.
Getting back into this soon...
as a note to self, besides from supporting cider-format, observing .cljfmt.edn would be interesting for dynamically generating :style/indent
values. This would elliminate any discrepancies between clojure-mode and cider-format's results.
(maybe useful: https://github.com/clojure-lsp/clojure-lsp/pull/1471)
I'm reworking this, will look quite different.
Did this get abandoned?
I found this issue from https://clojurians.slack.com/archives/C099W16KZ/p1692166428844959?thread_ts=1692163238.351989&cid=C099W16KZ
I'm having the same issue -- lsp-format-buffer
works differently from when I just press <return>
or <tab>
in a clojure file. It would be really great if there was a way to have consistent formatting.
@aiba sorry - Gmail buried this.
I actually have a newer cljfmt branch which might see the light of day around the next stable CIDER release.