This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-17
Channels
- # announcements (2)
- # babashka (1)
- # beginners (54)
- # calva (19)
- # clj-kondo (7)
- # cljs-dev (6)
- # cljsrn (18)
- # clojure (11)
- # clojure-europe (19)
- # clojurescript (7)
- # conjure (3)
- # cursive (7)
- # datomic (4)
- # figwheel-main (2)
- # fulcro (4)
- # helix (5)
- # honeysql (24)
- # instaparse (2)
- # lsp (20)
- # malli (17)
- # off-topic (6)
- # pathom (2)
- # practicalli (2)
- # shadow-cljs (2)
- # tools-deps (34)
- # vim (7)
but I'm used to other editors where I can just dd
and delete lines and not unbalance things
I use calva.selectCurrentForm
command and then use x
to cut the unwanted expression.
Its not as useful as the smartparens commands, but it does keep the parens balanced
Not really. If your code is properly formatted, you can sometimes get away with the command Infer parens (default bound to shift+tab
) after you have deleted the line.
calva doesn’t quite seem to know how to deal with this in terms of formatting and syntax:
(def lexer-single
{nil {:state :end
:out ::token/eof}
\( {:state :single
:out ::token/left-paren}
\) {:state :single
:out ::token/right-paren}
\{ {:state :single
:out ::token/left-brace}
\} {:state :single
:out ::token/right-brace}
\, {:state :single
:out ::token/comma}
\. {:state :single
:out ::token/dot}
\- {:state :single
:out ::token/minus}
\+ {:state :single
:out ::token/plus}
\; {:state :single
:out ::token/semicolon}
\* {:state :single
:out ::token/star}
\! {:state :bang}})
two things: the formatter shifts the map value too far when using nil
as the key. reproduce like this:
{nil 1
"foobar" 2}
secondly the syntax highlighting doesn’t handle character literals that are parens right. The map value here is highlighted as if it as the first part of list (a function):
{\( {:bar :baz}}
Thanks! The align map is experimental, quite quirky and likely to be removed. The syntax highlight we should be able to fix. Both issue and PR welcome. 😃
would you recommend I stop using the align map formatting? I like it and I saw some people use it, but it seems not to be very common.
It is a very tricky situation. I know it has a lot of users (hopefully not the majority, but anyway) and hesitate a lot removing the feature. But as it is now it holds us back in upgrading to latest cljfmt
. Which makes other users disappointed. … I doubt we will decide to remove the feature without replacing it with something. It’s a perfect example of what @U051BLM8F is trying to warn against here: https://www.youtube.com/watch?v=-Bx2rmD7mN0