Fork me on GitHub
#calva
<
2022-05-09
>
zeitstein09:05:28

This seems weird?

pez09:05:25

I don't think it is related to that issue, but that it probably is something Calva does. Please file an issue about it.

zeitstein09:05:36

Will do. Thanks.

🙏 1
dgb2310:05:47

For anyone who might be wondering why their VSCode editor suddenly might look ugly: https://code.visualstudio.com/updates/v1_67#_editor

😆 1
zeitstein18:05:31

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))

zeitstein18:05:26

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)))))}

zeitstein18:05:15

Something like :indents {#"^\w{4}" [[:inner 0]]} might also work.

zeitstein19:05:22

@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.

pez19:05:57

Maybe the difference is that It is nested in a map in one case and not in the other?

zeitstein19:05:44

No, I was careful to test the same.

pez19:05:37

Very strange then. I can see no reason why it would differ.

Max18:05:16

Has anyone else noticed pretty printing not working while jacked in using the nbb or joyride options?

borkdude18:05:22

@max.r.rothman This is still to be fixed.

👍 1
borkdude18:05:05

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

Max18:05:59

I might give that a shot. Fixing it in nbb should fix it in joyride, right?

borkdude18:05:19

No, they are similar but separate projects

👍 1
borkdude18:05:25

but both fixes should be similar

Max18:05:31

Would you prefer I file issues prior to making PRs, as per the dev doc?

borkdude18:05:50

We discussed it here, so it's ok to do a PR directly

👍 1
pez19:05:12

I prefer an issue, actually. 😃

Max19:05:10

one no-issue for nbb and one issue for joyride coming right up 😉

pez19:05:02

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.

👍 1
borkdude19:05:46

I do that normally too, but I thought, let's be nice for once

1
borkdude19:05:42

@U0ETXRFEW did you notice that the auto-created changelogs in github releases list PRs (solutions) and not the issues they fix? that bothers me

pez19:05:25

I've been wondering about that.

borkdude19:05:04

This is why I still manually write CHANGELOG.md

pez19:05:07

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.

borkdude19:05:32

ah I like that

pez19:05:35

Same here. Manual changelog.

pez19:05:23

Then:

BODY=$(awk '/^## \['${TAG_VERSION}'\]/, started && /^##/ { started=1; if ($0 !~ /(^#|^\s*$)/) { gsub(/["$]/, "\\\\&"); print } }' CHANGELOG.md)

borkdude19:05:24

I usually skip the auto-generated changelogs, people can just look in the repo

borkdude19:05:49

This is horrible... I'm leaving now to #babashka bye

pez19:05:07

awk is wonderful, haha

pez19:05:37

I'm going to write an awk library for Clojure some day. 😃

borkdude19:05:41

if you're working alone maybe

borkdude20:05:07

I'll take a look tomorrow

seancorfield21:05:05

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

pez22:05:12

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.

seancorfield22:05:19

I'm not using cider-nrepl at all.

pez22:05:46

Then I think that's what the error means. 😃

seancorfield22:05:54

I don't jack-in -- I connect Calva directly to a REPL that I start in the terminal.

seancorfield22:05:13

Ah, OK, so I need to port across my "run current test" snippet then... thanks...

pez22:05:41

That's what the copy jack-in command is for. So that you can adapt your command when starting the REPL.

seancorfield22:05:56

Is there documentation about which commands rely on CIDER so folks who don't use it know which Calva commands won't work?

seancorfield22:05:20

I don't want CIDER on my dev classpath thank you. I'm already unhappy that I have nREPL on it 😛

seancorfield22:05:56

(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)

pez22:05:59

Calva depends on cider-nrepl. It's stated all over the place.

seancorfield22:05:20

This seems to be the first command I've tripped over that depends on it tho'...

pez22:05:55

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.

pez22:05:12

Nonetheless: Calva is distilled from CIDER

seancorfield22:05:54

Feels like there should be a ™️ there 🙂

seancorfield22:05:04

Snippets to the rescue:

(tap> (with-out-str (binding [clojure.test/*test-out* *out*] (clojure.test/test-vars [#'$top-level-defined-symbol]))))

seancorfield22:05:21

(that's what I did with Clover)

pez22:05:08

I'm guessing you won't get the Test Explorer integration that way, but trade-offs, trade-offs.

seancorfield22:05:27

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).

seancorfield22:05:20

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.

pez22:05:02

I also have test-run snippets, btw. Because cider-nrepl still hasn't added ClojureScript support to the test runner.

seancorfield22:05:35

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)

metal 4
calva 4
🙏 5
1