This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-09
Channels
- # aws (3)
- # babashka (48)
- # babashka-sci-dev (1)
- # beginners (143)
- # calva (62)
- # clj-kondo (6)
- # clj-otel (3)
- # cljs-dev (59)
- # cljsrn (4)
- # clojure (39)
- # clojure-austin (5)
- # clojure-europe (60)
- # clojure-losangeles (1)
- # clojure-nl (2)
- # clojure-romania (4)
- # clojure-spec (3)
- # clojure-uk (2)
- # clojurescript (32)
- # datomic (17)
- # events (3)
- # figwheel-main (4)
- # graphql (3)
- # gratitude (2)
- # holy-lambda (52)
- # introduce-yourself (3)
- # jobs (1)
- # juxt (5)
- # kaocha (2)
- # lsp (33)
- # nyc (3)
- # off-topic (9)
- # other-languages (4)
- # overtone (1)
- # portal (21)
- # reitit (2)
- # remote-jobs (5)
- # shadow-cljs (65)
- # tools-deps (2)
- # xtdb (8)
Could my issue https://clojurians.slack.com/archives/C053AK3F9/p1652086685621209 be related to https://github.com/BetterThanTomorrow/calva/issues/1153 ?
I don't think it is related to that issue, but that it probably is something Calva does. Please file an issue about it.
For anyone who might be wondering why their VSCode editor suddenly might look ugly: https://code.visualstudio.com/updates/v1_67#_editor
Is it possible to achieve formatting summarised as: "Tonsky formatting" + exceptions? I'm mostly saitisfied with "Tonsky formatting", but just can't get used to it when working with e.g.: threading macros, and
, or
, etc. Example:
(and :foo
:bar
(long-function-name arg1 arg2
arg3))
Having this in .cljfmt.edn
seems to work:
{:remove-surrounding-whitespace? true
:remove-trailing-whitespace? true
:remove-consecutive-blank-lines? false
:insert-missing-whitespace? false
:align-associative? false
#_#_:indents ^:replace {#"^\w" [[:inner 0]]}
:indents {and [[:block 0]]
or [[:block 0]]
-> [[:block 0]]
->> [[:block 0]]
#"" [[:inner 0]]}
:test-code
(long-function-name a b
c
d
(and true
false)
(or true
(long-function-name arg1 args2
(->> :foo
:bar
(long-function-name arg1 arg2
arg3)))))}
@U0ETXRFEW What would be the reason for differences in formatting of :test-code
vs. in a .clj file? Example
;; :test-code
(map a
b)
;; .clj
(map a
b)
Settings:
:indents {reduce [[:block 0]]
reduce-kv [[:block 0]]
#"^\w{4}" [[:inner 0]]}
Including map [[:block 0]]
works correctly.Has anyone else noticed pretty printing not working while jacked in using the nbb or joyride options?
It was recently fixed in babashka.nrepl and it should be a matter of porting it to nbb and joyride. Please do: https://github.com/babashka/babashka.nrepl/commit/156ef6bfa59ba4a14ba6c69d1681fd7c2988a36d
Haha, awesome. It's just a thing I have, to clearly separate the problem and its solution. And to have a changelog consisting of problems handled rather than solutions or a mix of them.
@U0ETXRFEW did you notice that the auto-created changelogs in github releases list PRs (solutions) and not the issues they fix? that bothers me
I'm working on adding a CI pipeline now and am going to do the same as I do with Calva: upload the release notes from the changelog entry of the releaae.
Then:
BODY=$(awk '/^## \['${TAG_VERSION}'\]/, started && /^##/ { started=1; if ($0 !~ /(^#|^\s*$)/) { gsub(/["$]/, "\\\\&"); print } }' CHANGELOG.md)
PRs are up! https://github.com/BetterThanTomorrow/joyride/pull/53, https://github.com/babashka/nbb/pull/188
What does this error mean when I try to Run current test
:
; Running test: interactions-tests…
; The server does not recognize or cannot perform the 'test-var-query' operation
Looks like you might be using an old cider-nrepl
. Compare what you have in the project with what you get if you run the command Calva: Copy Jack-in Command Line to Clipboard.
I'm not using cider-nrepl
at all.
I don't jack-in -- I connect Calva directly to a REPL that I start in the terminal.
Ah, OK, so I need to port across my "run current test" snippet then... thanks...
That's what the copy jack-in command is for. So that you can adapt your command when starting the REPL.
Is there documentation about which commands rely on CIDER so folks who don't use it know which Calva commands won't work?
I don't want CIDER on my dev classpath thank you. I'm already unhappy that I have nREPL on it 😛
(remember: I'm coming from a plain Socket REPL where I needed no additional dependencies at all -- even having to use nrepl/nrepl
pains me)
This seems to be the first command I've tripped over that depends on it tho'...
TBH, I haven't kept myself up-to-date with changes in nREPL itself. But I know some cider-nrepl stuff has been moved over there.
Feels like there should be a ™️ there 🙂
Snippets to the rescue:
(tap> (with-out-str (binding [clojure.test/*test-out* *out*] (clojure.test/test-vars [#'$top-level-defined-symbol]))))
(that's what I did with Clover)
I'm guessing you won't get the Test Explorer integration that way, but trade-offs, trade-offs.
Yeah, I am used to a particular test workflow that I got into years ago that I particularly like, where I mostly just run one test at a time, as I am working on it, and can easily run all tests in the current ns (or all tests in the -test
ns associated with the current ns) with a hot key and just see the summary in Portal (previously Reveal, previously REBL).
It's kind of an extension of my "make a change, eval it" workflow where I operate in a very focused, localized way with immediate feedback.
I also have test-run snippets, btw. Because cider-nrepl still hasn't added ClojureScript support to the test runner.
For a long time, I've been using Clover for all REPL interactions and Calva for "everything else". One of the things that Clover provides is the ability to define "tasks" in VS Code using ClojureScript, interpreted by sci
, that let you query the editor and send forms to the REPL (as well as popping up alerts in VS Code). With the advent of #joyride I wondered if I could "port" my Clover-based workflow over to Calva, including all of the tap>
-into-Portal stuff that I do as a core part of my development flow. It turns out that Calva's customREPLCommandSnippets
provide almost all of the functionality I was relying on in Clover, along with eval-str
in Portal. So I present my https://github.com/seancorfield/vscode-calva-setup (formerly vscode-clover-setup
).
The only remaining missing piece is being able to evaluate a form and then open Simple Browser inside VS Code at the JavaDoc URL for that expressions type -- something I used a lot when wrestling with interop code.
(I also used to open ClojureDocs in the Simple Browser -- but given that Calva shows ClojureDocs examples in hovers for vars, the full page is less necessary)

