This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-26
Channels
- # announcements (17)
- # babashka (68)
- # beginners (8)
- # biff (14)
- # calva (25)
- # cherry (10)
- # clj-kondo (1)
- # clj-on-windows (12)
- # cljsrn (6)
- # clojure (134)
- # clojure-berlin (1)
- # clojure-europe (33)
- # clojure-nl (4)
- # clojure-norway (6)
- # clojure-uk (10)
- # clojurescript (9)
- # datalevin (8)
- # datomic (34)
- # docker (1)
- # emacs (31)
- # fulcro (6)
- # honeysql (8)
- # java (7)
- # joyride (14)
- # kaocha (7)
- # malli (11)
- # nbb (4)
- # off-topic (11)
- # pedestal (14)
- # rdf (53)
- # re-frame (6)
- # reagent (39)
- # reitit (2)
- # releases (9)
- # rewrite-clj (14)
- # shadow-cljs (97)
- # specter (1)
- # testing (5)
- # tools-deps (12)
- # vim (4)
- # xtdb (9)
I just learned that CIDER will "highlight" reflection warnings when evaluating a form that produces them (jumping to the offending location in the code). Should I raise an issue to document this for future reference?
Is this something that clj-kondo can help with statically? If so maybe it should be handled that way. But please file the issue on Calva anyway.
Apparently clj-kondo has a rule to remind you to enable (set! *warn-on-reflection* true)
but the actual warning comes when evaluating the form since it depends on what exactly you're calling.
There is one a bit annoying feature in Calva Paredit: Kill/Delete Right
If I have the following row and |
marks the cursor:
(count |[:a :b])
... and then I give command Calva Paredit: Kill/Delete Right
... I get:
(count|)
and not:
(count |)
... and therefore if I "paste" the form back I get:
(count[:a :b])
and not:
(count [:a :b])
...which I would like to get.
I'd like to know the rationale of the current implementation of Calva Paredit: Kill/Delete Right
(i.e. why to remove the space)?
I guess the best way to add the "missing space" is to create a custom Joyride script?This is not so much a Kill Right thing as it is a Calva Paredit thing. The edit commands follow up with a format of the current form. That formatting deletes surrounding whitespace. If we can identify the situation correctly we could do a special formatting that would keep that space. File an issue about it please.
It can probably be fixed using Joyride, but it is not trivial. You'll need to examine the form to make a decision if a space should be added or not.
That is caused by :remove-surrounding-whitespace?
rule in cljfmt. A config to disable that rule would make this go away, but would also break the many cases where applying this rule is desirable.
I plan to attempt patching Calva to override this rule by ignoring whitespace directly left of the cursor after any delete/kill that removed any non-whitespace. (But I have no ETA, and definitely would not complain if you beat me to it. 😉 )
..."Ignoring" whitespace left of the cursor is probably not accurate. From my digging so far, I think solving this will require proactively recording the existence of that whitespace, so it can be restored after cljfmt does its thing.
Calva already distinguishes between format-on-demand and format-as-you-type, relaxing the formatting for the latter case. It could be that this strategy should be expanded on, or some similar approach should be taken for Paredit-induced formatting (which counts as format-as-you-type).
Calva rules ok! 🙂 🚀 to the 🌔
Investigating this I realize that we are not using as-you-type formatting for post-Paredit format. This could be a bug, and it could be for good reasons, idk, but here's a build using this. Please take it for a spin, folks, and let me know how you fare. • Read some more about the experiment here: https://github.com/BetterThanTomorrow/calva/pull/1924 • VSIX: https://output.circle-artifacts.com/output/job/94e9e0f1-e680-4ddf-8004-3a54beb13597/artifacts/0/tmp/artifacts/calva-2.0.312-1922-paredit-ontype-formatting-da9c0f34.vsix
Here's a new VSIX, with the v2.0312 changes included: https://output.circle-artifacts.com/output/job/50420022-3c81-4fb4-8435-30c269b7e3ef/artifacts/0/tmp/artifacts/calva-2.0.312-1922-paredit-ontype-formatting-a2702aec.vsix
Hello everyone!
I'm new in Calva, just moved from another code editor and try doing some adaptation. Everything was fine when I'm doing the hello_repl.clj
from Calva: Fire up the Getting Started REPL
, but I get stuck (cannot formatting the code) when in ==Editing Code==
chapter, when i press 'tab' key nothing happened, Is there any configuration to handle this? Thank you
Hi there! Thanks for bringing this to our attention. Can you check if you have something else bound to the tab
key?
Thanks,
I've already do what you suggest and yeah there is 7 keybinding bound from the default source, but when i change the Calva Format: Format Current Form
keybinding into another key, it's still nothing happened (I already restart the VSCode)
You know what? I can reproduce this error. I think it is a regression from recent. Please file an issue. To try Calva formatting, for now you need to open a folder in VS Code and have some Clojure file opened there. You can copy the code from that Getting Started file.
OH WOW! yeah it's work! Automagically, i even don't press tab
, but yeah it's obviously work.
Thank you so much for helping me, I'll file an issue on Github.
Please do. It is super important that this works with the Getting Started REPL files too, as you can imagine.
@UGNFXV1FA I think we might have not tested those Uri/path changes in the Getting Started REPL. If you have the time, please have a look. Otherwise I'll do this. I'm not sure it is those changes, of course, it's just that the errors I get indicate this (complains about some Uri thing being undefined).
You know what? I can reproduce this error. I think it is a regression from recent. Please file an issue. To try Calva formatting, for now you need to open a folder in VS Code and have some Clojure file opened there. You can copy the code from that Getting Started file.
Investigating this I realize that we are not using as-you-type formatting for post-Paredit format. This could be a bug, and it could be for good reasons, idk, but here's a build using this. Please take it for a spin, folks, and let me know how you fare. • Read some more about the experiment here: https://github.com/BetterThanTomorrow/calva/pull/1924 • VSIX: https://output.circle-artifacts.com/output/job/94e9e0f1-e680-4ddf-8004-3a54beb13597/artifacts/0/tmp/artifacts/calva-2.0.312-1922-paredit-ontype-formatting-da9c0f34.vsix
Here's a new VSIX, with the v2.0312 changes included: https://output.circle-artifacts.com/output/job/50420022-3c81-4fb4-8435-30c269b7e3ef/artifacts/0/tmp/artifacts/calva-2.0.312-1922-paredit-ontype-formatting-a2702aec.vsix