This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-12-22
Channels
- # adventofcode (21)
- # announcements (2)
- # babashka (35)
- # beginners (45)
- # calva (22)
- # cider (28)
- # clj-kondo (39)
- # clj-on-windows (69)
- # clojure (28)
- # clojure-europe (15)
- # clojure-nl (7)
- # clojure-uk (24)
- # clojurescript (95)
- # cursive (9)
- # data-science (3)
- # datalevin (2)
- # emacs (11)
- # etaoin (9)
- # fulcro (1)
- # graphql (4)
- # jobs (8)
- # lsp (66)
- # malli (10)
- # missionary (3)
- # pathom (4)
- # polylith (67)
- # releases (3)
- # reveal (2)
- # shadow-cljs (53)
- # spacemacs (2)
- # specter (1)
- # sql (1)
- # tools-deps (6)
- # vim (4)
- # xtdb (16)
Hi, is there a way to configure zprint
to match calva formatter output? Maybe there is a config file somewhere?
I am not aware of one. There might be though. What you should be looking for is a config that replicates the behaviour of cljfmt defaults.
I’m seeing an issue where Calva Refactor: Expand Let duplicates let variables. (Aside, this is a great feature!) I’ll paste in the reproducer in the thread. I’d file a bug, but I don’t know if it’s on Calva, kondo, or clojure-lsp
The idea I had was to introduce a new variable and “push” it up to a previous let: start with (when (seq []) (let [x 5] (when (= x 5) (seq (vec (inc x)))))) 1) select (inc x) and use Calva Refactor: Introduce Let choose improved-x as the variable name (when (seq []) (let [x 5] (when (= x 5) (seq (vec (let [improved-x (inc x)] improved-x)))))) 2) stand on improved-x and Calva Refactor: Expand Let (when (seq []) (let [x 5] (when (= x 5) (seq (let [improved-x (inc x)] (vec improved-x)))))) 3) stand on the new improved-x and Calva Refactor: Expand Let (when (seq []) (let [x 5] (when (= x 5) (let [improved-x (inc x)] (seq (vec improved-x)))))) 4) stand on the new improved-x and Calva Refactor: Expand Let (when (seq []) (let [x 5] (let [x 5 improved-x (inc x)] (when (= x 5) (seq (vec improved-x)))))) We have x twice now. If we do Expand Let with improved-x again we’ll see (when (seq []) (let [x 5 x 5 improved-x (inc x)] (when (= x 5) (seq (vec improved-x)))))
@UKFSJSM38 I’ll file a github issue on clojure-lsp
Returning to Calva after some time away, I get this error message. “Build path specifies execution environment J2SE-1.5. There are no JREs installed in the workspace that are strictly compatible with this environment. ” In fact, Java 1.8 is installed, and in fact everything works as before, but I don’t know what has caused this error to appear. VSCode is also prompting me to install a “Java Extension Pack” for this Clojure project, which it didn’t do before. Any clues?
I think VS Code would only suggest that if you have Java files in the project. The error message about build path is not from Calva. What kind of project is it?
It’s a project defined by Sean Corfield’s clj-new. But I don’t see any place where a Java compiler version is specified, and there are no Java files in my project.
Here’s a repro, direct from clj-new: https://github.com/agoldhammer/repro1
Maybe it’s the pom.xml
file that causes VS Code to suggest the Java extension be installed?
Brilliant! Yes, removing that not only stopped the Java extension suggestion but also eliminated the warning about the JRE. Thanks!
Hmm. So I'll have to try this. Never seen a complaint liked that, and I have quite a few projects created using clj-new…
It may have something to do with the fact that I just updated clojure yesterday using brew on a Mac M1. With Apple silicon, brew keeps its software under /opt/homebrew/bin rather than /usr/local/bin. It may be that some config files are messed up.
Upgrading to an M1 caused some brew havoc for me as well. I exported my package list and imported it to a create a new package repo. Loving the M1! Such a fantastic machine.