For anyone with some time to spare and a heart beating for the newcomers to Clojure or to Calva. https://11500-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.173-814-connect-without-project-fa899f87.vsix) you can help me test. Here’s the relevant documentation page (outdated now, since I have changed my mind about some things while testing this, but still the spirit of the change should shine through). https://github.com/BetterThanTomorrow/calva/blob/814-connect-without-project/docs/site/getting-started.md
For comments on the guides. I’m not sure how to collect those in an efficient way. For now, use this issue that @slack_clojurians started: https://github.com/BetterThanTomorrow/calva/issues/1039
Hi! I'm migrating to calva these days, and so far it seems really nice. The one big disappointment so far has been code formatting, since cljfmt has issues with some variants of namespaced keywords: https://github.com/weavejester/cljfmt/issues/106. I know this is a problem that can only get fixed by people doing the job for free, se I'll just have to wait or do it myself. But my question is: Since I've heard so little about this, is the majority of clojure developers not using namespaced keywords in their codebases?
I never used cljfmt in projects until the current project. There are some interesting formatting rules but some do not seem to fit my workflow. I think I disabled most of them in the end. I don't believe an effective workflow should be constrained by formatting. Cljfmt is an interesting project, although it's not the canonical way to format Clojure code (according to the cljfmt project readme).
That's certainly true. But for 95% of my code layout, I fall back to just applying default formatting. It's particularly convenient for when you want the right side aligned in maps and lets. IMO that quickly gets out of sync if I don't auto format
Do you not use auto formatting at all?
I just posted this question in #reveal, but I’m not sure if it fits better over here, so I’m posting a link over here, hoping that someone recognizes my issue… https://clojurians.slack.com/archives/CUDTFQ152/p1613742962110400
I do use auto-formatting, via Emacs. which I just starting with LSP and cljfmt. Calva is a much smoother experience, but I still have a lot to learn. Hope you find some good suggestions.
I think namespace keywords is very common. I think that it might be the namespace alias syntax that is problematic for the formatter, and maybe not as common. I think that the one who knows the current state of this as far as cljfmt
is concerned might be @lee (because he knows stuff about rewrite-cljc
). Then there is also that Calva uses an aging fork of cljfmt
. There was work started to merge in latest, but it seems to have stopped. https://github.com/PEZ/cljfmt/pull/2
I think it is with reach to make Calva use something like zprint
for formatting (still would take a focused effort), but I also think it would run into the same problem. Since upstream it looks the same for both….
Another option we have is to rely on Calva’s indenter as a backup. Then we wouldn’t get full formatting when we hit this problem, but at least get things indented. Of all options I see, this is the one with the least effort needed.
Do you get the error also if you don’t use the middleware?
No when I use the dep-only version from the calva doc then I don’t get these errors.
I’m starting to suspect the Java version that I’m using. I’m using AdoptOpenJDK 8, and it seems with AdoptOpenJDK 11 it works better. I’ll test a bit more.
There a keyboard shortcut for tapping. So maybe the deps-only option could work pretty well?
Mostly curious. I haven’t quite figured out reveal myself, so have no idea how it is best used. 😃
Hi folks! This issue will be addressed in rewrite-clj v1 which I am currently pushing toward an alpha release.
So, then maybe if I update my cljfmt fork and make it use rewrite-cljc we can let Calva users opt in on testing it that way.
rewrite-cljc is dead, but is reborn in the clj-commons/rewrite-clj v1 branch (which when ready, will be merged to main)
Awesome. I’m not even sad that you killed my name for it. 😃
Ha!