Fork me on GitHub
#calva
<
2021-02-19
>
pez07:02:13

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

pez07:02:46

For comments on the guides. I’m not sure how to collect those in an efficient way. For now, use this issue that @U01NAG0N7FS started: https://github.com/BetterThanTomorrow/calva/issues/1039

ingesol08:02:24

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?

practicalli-johnny08:02:27

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).

ingesol08:02:11

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

ingesol08:02:25

Do you not use auto formatting at all?

practicalli-johnny15:02:40

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.

👍 3
pez15:02:24

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 @UE21H2HHD (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

pez15:02:19

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….

pez15:02:11

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.

lread16:02:34

Hi folks! This issue will be addressed in rewrite-clj v1 which I am currently pushing toward an alpha release.

metal 3
👍 9
pez16:02:43

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.

lread16:02:11

rewrite-cljc is dead, but is reborn in the clj-commons/rewrite-clj v1 branch (which when ready, will be merged to main)

pez17:02:05

Awesome. I’m not even sad that you killed my name for it. 😃

ingesol07:02:35

Thanks for your effort on rewrite-clj, @UE21H2HHD, very impressive. And I'm totally ready to test the calva integration on the bleeding edge 🙂

ingesol07:02:12

We use the namespace alias syntax a lot, and I also use auto formatting a lot, so I'm heavily affected by this bug.

Stefan13:02:00

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

pez15:02:58

Do you get the error also if you don’t use the middleware?

Stefan16:02:17

No when I use the dep-only version from the calva doc then I don’t get these errors.

Stefan16:02:09

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.

pez16:02:07

There a keyboard shortcut for tapping. So maybe the deps-only option could work pretty well?

pez16:02:09

Mostly curious. I haven’t quite figured out reveal myself, so have no idea how it is best used. 😃