calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
grumplet 2021-01-26T10:31:50.207200Z

After connecting calva and reveal, all is OK until I happen to edit an edn data file… Then I get an Unhandled REPL handler exception.

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.7"}}}' -A:reveal:config
nREPL server started on port 52491 on host localhost - <nrepl://localhost:52491>
ERROR: Unhandled REPL handler exception processing message {:op info, :ns user, :symbol resources/public/kidney/edn, :id 15, :session 476d9211-b2ba-41c0-b382-65b4c724e4ff}

grumplet 2021-01-26T10:39:58.209400Z

That ‘Calva Jack-in Clojure CLI’ terminal then continues to log errors even when returning to edit a clj file. The repl and reveal do both continue to work. Errors logged look like this:

ERROR: Unhandled REPL handler exception processing message {:op info, :ns transplants.configure, :symbol , :id 74, :session 476d9211-b2ba-41c0-b382-65b4c724e4ff}
java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to java.lang.ClassLoader 

pez 2021-01-26T10:54:49.209800Z

Do you know if it happens only when used together with reveal?

grumplet 2021-01-26T11:00:38.213300Z

Still experimenting… comparing 2.0.134 at present - which appears to be working OK with reveal and visiting an EDN file. I’ll upgrade again and try without reveal…

pez 2021-01-26T11:04:41.215500Z

Not sure about 134, but we've added a setting for changing the jack-in versions of dependencies. Thinking it could be something with those...

grumplet 2021-01-26T11:10:46.217100Z

OK - so it’s possible that EDN is not the trigger. In 2.0.153 again and this time without reveal, and a jack-in gives me:

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.8.3"} cider/cider-nrepl {:mvn/version "0.25.7"}}}' -A:config -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
WARNING: When invoking clojure.main, use -M
nREPL server started on port 52880 on host localhost - <nrepl://localhost:52880>
ERROR: Unhandled REPL handler exception processing message {:op info, :ns transplants.configure, :symbol separate, :id 7, :session 01f14827-e8e0-4fbb-bd7b-5b336e17facb}

grumplet 2021-01-26T11:11:06.217300Z

Just weird.

grumplet 2021-01-26T11:11:36.217700Z

That was when visiting a clj file.

grumplet 2021-01-26T11:13:34.218700Z

Things are not consistent here so it’s difficult to report. I closed vscode and retried, and there was no problem (without reveal)

grumplet 2021-01-26T11:24:55.221600Z

Back to reveal. This time jack-in asks ‘Add port to nREPL if localhost’ - it usually doesn’t. I give it the port where nREPL started and reveal connects. No error when visiting EDN. More weirdness 😞

grumplet 2021-01-26T11:50:25.222900Z

I continued working with that set up. But later the exception reappeared - I don’t know what triggered it. Ignoring it for now. Here’s the stack trace: https://gist.github.com/gmp26/7fccddb014559990e82c27139ba2cbec

pez 2021-01-26T12:08:03.223Z

Lots of dependency weirdness,, indeed. But it’s good you have seen it and investigated it some. As more clues are collected we’ll probably figure it out eventually.

pez 2021-01-26T12:08:08.223200Z

Bump @claudius.nicolae about finishing his PR about that port prompt. 😃

2021-01-26T15:28:14.225800Z

When I try to evaluate a bad code like this (assoc [] [:foo :bar] 42) I get no feedback at all. In 2.0.152 it works as expected throws an error: ; Execution error (IllegalArgumentException) at zelark.aoc.maze/eval6016 (REPL:26). ; Key must be integer Is it a known issue?

2021-01-27T08:08:55.241100Z

An important note: after I downgraded to 152, it seems the issue doesn’t appear at all.

2021-01-27T08:14:20.241300Z

@bozhidar I wonder can it be related to the latest fix in Orchard https://github.com/clojure-emacs/orchard/blob/master/CHANGELOG.md#064-2021-01-25

bozhidar 2021-01-27T08:15:27.241600Z

Yeah, there was an issue there, that's already fixed in the next Orchard/cider-nrepl release.

pez 2021-01-27T11:18:32.244200Z

In which case you can solve this for your install, @zelark, by using the jack-in dependency settings: https://calva.io/customizing/#jack-in-dependency-versions

2021-01-27T11:33:03.244500Z

Oh, that’s a good point, I forgot about it. But it’s better to update for all calva users.

bringe 2021-01-27T17:34:15.244900Z

Yeah an update to cider-nrepl 0.25.8 is in the dev branch already, will go out next release

✔️ 1
clyfe 2021-01-26T16:09:38.226Z

pr finished, let's merge; that and keybindings one too

clyfe 2021-01-26T16:48:42.226200Z

Works for me. Can you give more context?

pez 2021-01-26T16:48:55.226400Z

Last time I checked there were review issues with the PR. Have you fixed those?

clyfe 2021-01-26T16:52:02.226600Z

I think so

bringe 2021-01-26T17:10:32.226900Z

Weird! I wonder if it's something with some code in your project that's causing cider-nrepl/orchard to throw this error

bringe 2021-01-26T17:12:07.227100Z

If it keeps up, and you can provide a repro project + steps to make it happen consistently, an issue with that repro project linked would be good. Soon cider-nrepl will be upgraded to 0.25.8 (next release), and was recently upgraded to 0.25.7, so I wonder if there is something that changed to cause that, and I wonder if it'll be resolved after an upgrade

bringe 2021-01-26T17:14:42.227300Z

I get that error in 2.0.153. Not sure what could be going on. Have you tried reloading your VS Code / repl?

pez 2021-01-26T17:22:00.227500Z

It says review pending when I check. There’s a file watcher added that is not needed.

2021-01-26T19:00:19.227700Z

After restarting the editor it has gone. Thanks.

2021-01-26T19:08:08.227900Z

But seems like there is some other problem that is related to namespaces switching. I’ll try to reproduce it and make a capture of my screen.

👍 1
clyfe 2021-01-26T19:41:22.228300Z

Do we want the watcher as a fallback? In case regex yields no port?

clyfe 2021-01-26T19:42:50.228500Z

Not sure what the pending thing is, I have no feedback there myself.

grumplet 2021-01-26T21:03:34.228700Z

I wondered that too, but the stack trace doesn’t go near my code. All this weird stuff started happening after the Christmas break and when I go back to the pre Christmas release (134 is my favourite) it stops happening.

Piotr Brzeziński 2021-01-26T21:47:03.229600Z

Hey! Just installed calva and I have run into a weird problem. Getting bunch of unresolved symbol errors. Why could that happen?

bringe 2021-01-27T17:36:03.245100Z

@pez If I'm not mistaken the message they're concerned about is from clj-kondo, and the config they're looking for is clj-kondo config. Clojure-lsp is just the middleman here.

bringe 2021-01-27T17:39:51.245700Z

Oh, I see you mean lsp would be the thing to provide a quick-fix or something.

bringe 2021-01-27T17:43:54.246Z

I'm not sure what options lsp has to provide any help here, as it's merely providing diagnostics via the protocol structure, and VS Code is the thing that renders the diagnostics in that way.

borkdude 2021-01-27T17:45:24.246300Z

A quick fix would be a link to the relevant doc

bringe 2021-01-27T17:46:18.246500Z

Yeah, I'm just not sure how that could be provided

bringe 2021-01-27T17:46:37.246700Z

Unless you mean in the lint warning itself from clj-kondo

bringe 2021-01-27T17:50:27.246900Z

But that would seem maybe a bit too much / crowded. I don't know off hand how we can control what pops up there when they hover, is what I mean. Maybe there is a way though. If we were to try to make lsp provide a link via the hover lsp message, then it would need to cross reference diagnostics on the server before providing hover content. Other than than, I suppose maybe Calva could add a hover provider and reference the diagnostics received from lsp. Seems a bit complex for something like this though, but probably doable.

ericdallo 2021-01-26T21:48:40.229900Z

You probably didn't configured the :lint-as for that macro with-let

bringe 2021-01-26T21:51:35.230400Z

I think there's been at least a couple upgrades of jack-in deps, maybe some back around that time, so that could be it.

Piotr Brzeziński 2021-01-26T22:03:01.230600Z

Oh ok, makes sense. Thank you.

👍 1
bringe 2021-01-26T22:04:39.230900Z

Hello and welcome! Glad to see you've got some help.

bringe 2021-01-26T22:16:21.231100Z

Wondering if this is related to this: https://github.com/clojure-emacs/orchard/issues/103. I linked your gist there and asked about it

bringe 2021-01-26T23:27:04.231500Z

https://github.com/clojure-emacs/orchard/issues/103#issuecomment-767874955 Looks like this is fixed now. Hopefully with the next Calva release which includes a cider-nrepl update, you won't see this error any more.