This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-07
Channels
- # announcements (37)
- # babashka (28)
- # beginners (104)
- # calva (28)
- # cider (32)
- # clj-kondo (35)
- # cljs-dev (4)
- # cljsrn (3)
- # clojure (35)
- # clojure-conj (4)
- # clojure-dev (57)
- # clojure-europe (4)
- # clojure-france (6)
- # clojure-gamedev (1)
- # clojure-germany (1)
- # clojure-hamburg (2)
- # clojure-italy (7)
- # clojure-nl (4)
- # clojure-spec (9)
- # clojure-uk (11)
- # clojuredesign-podcast (2)
- # clojurescript (36)
- # clojurex (48)
- # core-async (6)
- # cursive (12)
- # data-science (1)
- # datomic (21)
- # defnpodcast (7)
- # duct (1)
- # events (1)
- # fulcro (56)
- # graalvm (30)
- # graphql (5)
- # jobs (1)
- # joker (21)
- # keechma (1)
- # leiningen (4)
- # off-topic (109)
- # parinfer (20)
- # pathom (27)
- # re-frame (4)
- # shadow-cljs (80)
- # spacemacs (18)
- # sql (32)
- # testing (2)
- # tools-deps (32)
- # vim (20)
Hey, that ^ VSIX is old! Here’s a new one with support for thread-first arguments: https://2023-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.58-wip-sinature-handler-use-paredit-2f4c8a1e.vsix The gif shows the various cases that I have been able to come up with, with @qythium’s help.
Is there a way to configure auto indentation on macros. for instance, I would like to get 2 indents under conjure/mocking
(conjure/mocking
[datadog/inc]
(testing "testing.."
(is (= 1 1))))
CIDER respects indentation metadata. https://docs.cider.mx/cider/indent_spec.html
Right now there is no way at all for the user to inform Calva about the indentation settings. The relevant issue is here: https://github.com/BetterThanTomorrow/calva/issues/80
It is old and quite painful for me to see how often I have committed to try fixing it… It is really not that hard. We use cljfmt for the formatting + our own autoformatter that is still in experimental stage and opt-in for users. But it uses a compatible indentation settings format so if we just expose one or two good ways to give Calva the cljfmt indent settings, then both of Calva’s formatters can use it.
Calva v2.0.58 is out. Please upgrade, folks. The changes are: • Fixed: Incorrect red highlights around brackets/paren in specific case • Fixed: “Require REPL Utilities” command is longer broken • Fixed: Hover definition for symbols derefed with @, and quoted symbols • Improved: Signature help-while-typing hover, with active arg markup
Also published clj-kondo VSCode extension v0.0.9 which brings datalog linting and support for compojure macros. You guys and girls get a heads up, since the official announcement will happen later today together with a blog post about the datalog linting.



@pez on the topic of formatting, is there any way to use the same formatting settings that calva has outside of calva?
I'd like to format my whole cljs project in a way consistent with calva
ok let me give a practical example
I have a cljs project, on that project I use both Calva in the editor and zprint via the npm module (https://github.com/clj-commons/zprint-clj)
when I edit files, calva will format it in a certain way
I edit a couple of files and save the changes
then I run zprint over the whole project to make sure all formatting is consistent via a script
zprint will reformat the calva files in different ways
this is mostly a question of configuration: I either configure zprint to match Calva, or the other way around
(or I figure out a way to use clj-fmt)
If I recall correctly Calva uses default clj-fmt indentation rules. And then it depends on the settings you have for calva-fmt.
Also if I recall correctly it is hard to stop zprint from doing certain things that clj-fmt doesn’t do, so I would guess that using clj-fmt would be your main option.
ok, I'll look into my options this weekend... maybe I can use shadow-cljs run
to run https://github.com/weavejester/cljfmt
This is the settings map that Calva uses to configure clj-fmt:
{:remove-surrounding-whitespace? t/f
:remove-trailing-whitespace? t/f
:remove-consecutive-blank-lines? t/f
:insert-missing-whitespace? t/f}
They correspond to settings you have in VSCode for calva-fmt
. So feeding clj-fmt that map, with your settings should make clj-fmt produce the same formatting as Calva does.ok, will try those
thank you