Fork me on GitHub
#calva
<
2022-01-24
>
punit-naik07:01:00

My repl gets stuck at why I try to jack-in:

; This is the Calva evaluation results output window.
; TIPS: The keyboard shortcut `ctrl+alt+c o` shows and focuses this window
;   when connected to a REPL session.
; Please see  for more info.
; Happy coding! ♥️
Then if I restart/reload vscode without modifying any files and head straight to jacking-in, it starts up. Any ideas on this?

Lukas Domagala09:01:16

sounds like a weird race-condition. does clojure-lsp start up correctly?

punit-naik10:01:21

@U02EMBDU2JU Yes it is starting correctly.

Lukas Domagala10:01:28

@U5BRU7X8Q let me see if I fully understand your reproduction: You start vscode, call the jack-in command -> the repl never finishes starting and the calva-repl window hangs with your message. When you reload (restart extension host command?) and jack-in everything works?

punit-naik10:01:23

@U02EMBDU2JU Yes, when I execute Reload Window and jack-in, it starts correctly, but onyl if I don't edit any clj files before doing so.

Lukas Domagala10:01:45

@U5BRU7X8Q thats a strange one 😅 in the broken case, does a terminal open that tries to start the nrepl? and please try the “Calva: Copy Jack-In Command to Clipboard”, copy that into a terminal and then do “Calva: connect to a running repl”. If that works, we narrow it down by a lot

Marc O'Morain11:01:56

I noticed a strange behaviour in the Test Explorer and Clojure LSP interplay: Since I typed in this name of this test, it looks like LSP returned a bunch of partial matches, and emitted Test Tree items for the partially typed names of the test.

Marc O'Morain11:01:37

We don’t have a way of knowing when tests are removed from a namespace, so the test tree has a risk that it will grow and become stale.

Lukas Domagala11:01:45

whats the name of the LSP rpc call you are making here? I’ve spend too much time debugging the calva<->lsp connection lately, might as well use the new knowledge to help out here 🙂

❤️ 1
Marc O'Morain11:01:13

clojure-lsp emits a new TestTree event since the most recent version

Marc O'Morain11:01:18

@U02EMBDU2JU I don’t think there is a bug per se, I think the way the Test Explorer feature works is flawed.

ericdallo12:01:24

Yeah, @U0K592YDP clojure-lsp should send a event if that file as changed and you should take that as the new truth. But we probably are not sending that when a file is deleted, maybe we should or client can handle that already by itself?

Marc O'Morain11:01:07

My other Test Explorer find of the day. I’m connected to a project that has a running REPL, but the cider-nrepl middleware is not loaded by this project. (I connected to an existing REPL, I didn’t Jack In). When you try to run a test, we handle the case pretty gracefully:

clj꞉workflows-conductor.workflow.config-test꞉> 
; Evaluating file: config_test.clj
#'workflows-conductor.workflow.config-test/stand-alone-project-filters
; Running test: stand-alone-project-filters…
; The server does not recognize or cannot perform the 'test-var-query' operation
The error message `The server does not recognize or cannot perform the 'test-var-query' operation
Describes exactly what the problem was, but it doesn’t explain it in a way that is very helpful to the user, nor does it teach them how to fix the problem. Does anyone have any ideas on how we can surface this in a better way to the user?

🙏 1
bringe02:01:17

Maybe mentioning that cider-nrepl is either missing as a repl dendency or a late enough version is not being used would be helpful as a start. Maybe it could also mention using jack-in, or using the command to copy the jack-in command in order to start the repl manually with the right dependencies (or use it as a reference to do so).

bringe02:01:33

As a beginner, something telling me to “try jack-in” would be more hepful than “this dependency you probably aren’t familiar with and might not know how to add is missing,” so just mentioning the cider-nrepl part is probably not very helpful, at least in that case.

Eugen15:01:34

clean ns no longer works for me , latest Calva - 2.0.235

bringe02:01:41

A fix will be out soon.

bringe02:01:35

There was a change in clojure-lsp which led to an exception in code that runs after clojure-lsp starts in Calva. Code that followed the code that threw the exception was being skipped, and as a result some commands weren’t being registered.

bringe03:01:44

The fix is released now. calva

Eugen08:01:59

thanks, tested and confirm it's working 🙂

🎉 1