calva

pez 2026-02-20T10:22:18.153349Z

Dear Calva friends. calva https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.557 • Add “Restart the Project REPL (a.k.a. Re-jack-in)” option to the connected REPL menu This is actually an alias to the regular jack-in command, which already disconnects and re-connects as necessary. But this was not obvious enough to users.

👏 1
Max 2026-02-20T14:36:20.183499Z

Here's a weird one: when I run a test that uses https://github.com/nubank/matcher-combinators using an external test runner, I get an output that looks like this:

FAIL in (string-with-quotes-test) (test_test.clj:120)
expected: (match? "foo bar" [])
  actual: (mismatch (expected "foo bar") (actual []))
But when I run it in Calva's test runner with the REPL window output destination, I get this:
; FAIL in (string-with-quotes-test) (test_test.clj:120)
; expected:
(match? "foo bar" [])

; actual:
(mismatch (expected foo bar) (actual []))
Notice that the quotes around "foo bar" are gone. This isn't great b/c it makes it hard to tell what's actually in the failing data. For example:
(is (match? "foo bar"
              ["foo" "bar"]))
;=>
(mismatch (expected foo bar) (actual [foo bar]))

(is (match? "foo bar"
              ["foo bar"])
;=>
(mismatch (expected foo bar) (actual [foo bar]))
Both of these examples result in the same output, despite them having different inputs. Any ideas as to why Calva's test runner would be removing the quotes?

seancorfield 2026-02-20T15:02:15.800599Z

I'm curious if you'd see the same thing if you set all the Calva output destinations to terminal?

Max 2026-02-20T15:41:45.477439Z

It's the same in the terminal output destination

pez 2026-02-20T17:30:10.888649Z

I vaguely recognize this… But can’t quite recall.

Max 2026-02-20T17:55:48.800689Z

Any idea where I would go looking for the cause of the issue?

pez 2026-02-20T17:56:52.866289Z

I would catch it in the debugger and examine the stack frames.

pez 2026-02-20T17:58:36.952529Z

Seems 100% to me as something in Calva. There is not much indirection between the nrepl response and what Calva prints, so should be quick to spot. But that could be famous last words all over.

Max 2026-02-20T18:21:37.468229Z

Any hints for where to stick the breakpoint for a newbie to the code base?

pez 2026-02-20T18:45:21.469169Z

I’m afk, but there’s an output module, so if you catch it there you can backtrack all the way through the whole chain.

Max 2026-02-20T19:17:01.030979Z

As best I can tell, it's coming from the repl server that way. I'm seeing no quotes all the way up to a call to session.test https://github.com/maxrothman/calva/blob/46a909b86d4a0244af5f9b72aac4697d85e82cf9/src/testRunner.ts#L383 which is where it looks like the request to run the test is sent to the server. Here's the whole string it has:

; FAIL in minimal.hello/foo (hello.clj:6):
; expected:
(match? "foo" ["foo"])

; actual:
(mismatch (expected \x1b[33mfoo\x1b[0m) (actual \x1b[31m[foo]\x1b[0m))
The escape sequences are color codes, but there's no quotes in sight. Could this maybe be coming from cider instead?

Max 2026-02-20T19:21:49.901359Z

That answer seems plausible, cider https://github.com/clojure-emacs/cider/issues?q=is%3Aissue%20matcher-combinators and has special handling to deal with escape codes. I'll post over there

pez 2026-02-20T19:39:57.533649Z

Wow. My first suggestion, which I suppressed, was to check the Calva nrepl log, 😀

Max 2026-02-20T19:40:34.303019Z

It wouldn't have helped, it truncates the map

pez 2026-02-20T20:27:07.278579Z

We should fix that.

Max 2026-02-20T20:29:11.370079Z

It looked somewhat intentional. More accurately, it didn't expand maps deeply nested in the data

Max 2026-02-20T20:52:59.115659Z

It looked like this:

{
  'elapsed-time': { humanized: 'Completed in 6 ms', ms: 6 },
  'gen-input': [],
  id: '15',
  'ns-elapsed-time': { 'minimal.hello': { humanized: 'Completed in 6 ms', ms: 6 } },
  results: { 'minimal.hello': { foo: [Array] } },
  session: '90e21166-dd42-493c-9733-c9f1f9a06fab',
  summary: { error: 0, fail: 1, ns: 1, pass: 0, test: 1, var: 1 },
  'testing-ns': 'minimal.hello',
  'var-elapsed-time': { 'minimal.hello': { foo: [Object] } }
}
You can see a few spots (`[Array]`, [Object] where it wasn't fully expanded

pez 2026-02-20T21:15:51.339959Z

Yes, it is somewhat intentional. Responses can be huge. But some way to either specify the depth or to drill down, could be devised.

Max 2026-02-20T21:17:55.883609Z

I almost wonder if you want to log them to the debug console where they can be expanded as needed

pez 2026-02-20T21:40:49.080769Z

Yeah, sounds super pragmatic and helpful.

pez 2026-02-20T21:43:10.722109Z

We could consider switching to logging to the debug console instead of the output channel…

pez 2026-02-20T15:38:21.703599Z

Dear Calva friends. calva https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.558https://github.com/BetterThanTomorrow/calva/issues/3091 A follow up on the mere cosmetic update earlier today. Now it is truly re-jack-in.

👏 1
❤️ 1
Chanakya 2026-02-20T16:29:51.700779Z

Missed the re-jack-in since the multi nrepl update. Thanks for adding it back and this one too.

🙏 1
pez 2026-02-20T16:41:49.814309Z

You should have told me you missed it! 😃

🫣 1
pez 2026-02-20T16:43:41.662059Z

But this was good in the end because the contributor who added it also wanted it to be a more proper jack-in, something I hadn’t really thought about, when I instead deemed it a waste of menu space to have the same command twice with different names.