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`.
2020-10-25T02:15:26.456700Z

There was a problem with the last few versions of the program that prevented jack-in. Downgrade to version 2.0.126 and it should be good again. I don't know whether or not this has been fixed yet.

borkdude 2020-10-25T10:18:08.457Z

it seems to be a windows only problem

manas_marthi 2020-10-25T15:14:38.458Z

hi all, can some one please advise how to run expectations in calva.. I am running _"command"_: "calva.runTestUnderCursor", short cut, it does not seem to trigger expectations properly..

manas_marthi 2020-10-25T15:27:18.458600Z

How do I evaluate these in repl from calva (expect ClassCastException (Integer. "99")) (expect ClassCastException (Integer. 99))

manas_marthi 2020-10-25T15:32:31.459500Z

I am also getting evalCurrentFormInREPLWindow not found error

manas_marthi 2020-10-25T17:03:58.460800Z

And how to fix broken indentation using calva

(facts "About `first-element` "
         (fact "it normally returns the first-element 33"
                  (first-element [1 2 3] :default) => 1)
     
       (first-element nil :default) => :default)

pez 2020-10-25T17:05:59.461200Z

What's wrong with the indentation?

bringe 2020-10-25T17:19:42.465200Z

I don't know for certain that the test runner works with expectations (have not used expectations much, and never with the test runner). It depends I guess on whether cider-nrepl sees the tests. @manas.marthi If you can provide some repo code in an issue where tests are not found that would help. evalCurrentFormInREPLWindow is no longer a command. I think that was only with the old repl window. What causes this error for you?

pez 2020-10-25T17:19:44.465400Z

Dear Calva-friends: I have found the error with jack-in regression on Windows. It's fixed in this VSIX. Can you windows users run with that and see that it works now? Also Mac and Linux users can test it to check that it doesn't break stuff there. (Jack in to some projects and it should just work as before). https://8470-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.130-827-fix-windows-jack-in-193b17e5.vsix

bringe 2020-10-25T17:23:35.465500Z

I've just tested jack-in with a clojure cli project, multi-project folder, and lein+figwheel on arch linux and all worked fine 🎉

pez 2020-10-25T17:24:11.465700Z

Awesome. Thanks!

manas_marthi 2020-10-25T17:35:42.468800Z

Hi @brandon.ringe, The tests are running, but the result of expectations are not being reported.. It is just compiling the form and not doing anything about it I tried evaluating the form and evaluating the selection. (expect ClassCastException (Integer. 99)) is not getting reported as a failure.. Hi @pez, I am hoping to remove extra leading spaces and blank lines like below

(facts "About `first-element` "
   (fact "it normally returns the first-element 33"
      (first-element [1 2 3] :default) => 1)
      (first-element nil :default) => :default))

manas_marthi 2020-10-25T17:36:12.469200Z

(deftest manas-unit-tests
  (testing "Canary test"
    (is (= 1 1)))

manas_marthi 2020-10-25T17:37:28.470400Z

This above test is running fine. When I use the expectations and run the run test under cursor it is not running

manas_marthi 2020-10-25T17:38:23.471700Z

Hi @pez I copied the shortcuts from the link given under "Replace all Calva `ctrl+alt+...` key bindings with `ctrl+shift+...`," part of the wiki. It has that evalCurrentFormInREPLWindow https://gist.github.com/PEZ/3fc22e015e0d33fb9b73074fd6abf292

pez 2020-10-25T17:39:17.472300Z

Yeah, those should be updated.

manas_marthi 2020-10-25T17:39:18.472500Z

PS: I am using Calva via Windows subsystem for linux on Windows

manas_marthi 2020-10-25T17:40:13.473300Z

Ctrl+Shift+p also is not working for some reason. It is adding curly braces

pez 2020-10-25T17:41:40.473700Z

That's probably not Calva's doing though.

pez 2020-10-25T17:42:57.474900Z

You need to configure the indentation to work to your taste: https://calva.io/formatting/#configuration (Though I don't think you can make it remove single blank lines.)

manas_marthi 2020-10-25T17:43:34.475400Z

ok.. thank you. i'll go through that

manas_marthi 2020-10-25T17:44:15.476300Z

What is the expected behaviour of "calva.loadFile", Does it recompile and reload the namespace?

manas_marthi 2020-10-25T17:45:14.477700Z

I had two deftests and then merged both into single deftest the updated contents work when I run run test under cursor . But old deftests were running when I ran run tests in the namespace

manas_marthi 2020-10-25T17:45:28.478100Z

Looks like the old deftest got retained in the namespace definitions

pez 2020-10-25T17:48:21.478700Z

Yeah, I don't think it resets the namespace. See if the refresh namespace commands do that for you.

manas_marthi 2020-10-25T17:51:30.479800Z

{
  "key": "",
  "command": "calva.refresh"
} /

pez 2020-10-25T17:51:33.480100Z

As for tests, I'm thinking that maybe expect stuff is not seen by cider-nrepl. Are you using Midje?

manas_marthi 2020-10-25T17:51:43.480400Z

Is that it? It does not seem to have any key associated with it

pez 2020-10-25T17:52:28.481700Z

yeah, that's probably the one.

pez 2020-10-25T17:52:46.482300Z

Assign a key to it if it seems to be what you need. 😃

pez 2020-10-25T17:54:31.484100Z

There is also a refreshAll.

manas_marthi 2020-10-25T17:54:39.484400Z

I am doing the examples in clojure workshop book by @viebel. The book uses lein expectations to run expectations. But I was unable to run them from within the vscode. I then started using Midje. I had to run (autotest) on the repl and the tests are running automatically. I am not running any (facts individually

manas_marthi 2020-10-25T17:56:06.486Z

So canthe run tests in namespace not refresh the namespace like what midje is doing?

pez 2020-10-25T17:56:07.486100Z

I think maybe the Calva (CIDER) test runner doesn't see Midje tests. Might work better with metosin/testit.

pez 2020-10-25T17:56:42.486700Z

(I haven't tried it, but I see that testit uses deftest, so maybe, maybe.)

manas_marthi 2020-10-25T17:58:26.488Z

Okay, well for now, midje re running them all with updated sources, so I am okay now with what's going on with the tests

pez 2020-10-25T17:58:58.488900Z

Cool. Let us know if you try testit, b/c I'm curious. 😃

manas_marthi 2020-10-25T17:59:08.489200Z

I have one more doubt about executing commands on cursor and the placement of cursor on the next line

pez 2020-10-25T17:59:45.490500Z

What's the doubt?

manas_marthi 2020-10-25T17:59:48.490600Z

I tried (println 1) and I had to hit ctrl+enter to get it running. The cursor got placed in the line after the arrow in the next cursor

pez 2020-10-25T18:00:17.491400Z

Didn't alt+enter work?

manas_marthi 2020-10-25T18:00:35.492Z

No. It is not working

manas_marthi 2020-10-25T18:00:56.492500Z

Nothing happens when I hit alt+enter

manas_marthi 2020-10-25T18:01:11.493Z

Probably because I copied those commands from that gist?

pez 2020-10-25T18:01:22.493300Z

Does it work using alt+enter in code files?

manas_marthi 2020-10-25T18:02:02.494Z

yeah it does

pez 2020-10-25T18:02:31.494800Z

File an issue about it. It should work in the repl window as well.

pez 2020-10-25T18:03:23.495600Z

The cursor is placed below the prompt on purpose, btw.

manas_marthi 2020-10-25T18:03:57.496100Z

Okay. And alt+enter for expect does not show the output of the assertion. It shows the below output

manas_marthi 2020-10-25T18:04:36.496900Z

How to clear the contents of the repl buffer?

manas_marthi 2020-10-25T18:05:04.497400Z

pez 2020-10-25T18:05:20.498100Z

Probably expect defines something. If you want to execute it, wrap in parens should work.

manas_marthi 2020-10-25T18:05:25.498400Z

clj::cljworkshop.core-test=> 
#'cljworkshop.core-test/expect-1861403530
clj::cljworkshop.core-test=> 
1
nil
clj::cljworkshop.core-test=> 
#'cljworkshop.core-test/expect-1861403530
clj::cljworkshop.core-test=> 

pez 2020-10-25T18:06:00.499100Z

The repl is mainly a regular file. Select all + delete clears it.

1
manas_marthi 2020-10-25T18:11:15.000100Z

I assigned ctrl+, ctrl+r to calva refresh. It does not give any feedback message about the result of refresh

manas_marthi 2020-10-25T18:20:49.000200Z

Done. https://github.com/BetterThanTomorrow/calva/issues/829

manas_marthi 2020-10-25T18:22:18.002Z

Ctrl+Alt+l is doing the job I need. And Ctrl+A+Del is clearing the buffer. I am good for now. Thank you very much for responding to my queries..

pez 2020-10-25T19:00:19.002800Z

Cool! We are here should you run into more issues.

❤️ 1
pez 2020-10-25T19:00:40.003Z

Thanks!

manas_marthi 2020-10-25T21:35:22.003900Z

Sean advised that I should be using expectations/clojure-test instead of classic expectations so that it works from file buffer.. I tried it. It is working fine . Thanks..

bringe 2020-10-25T22:46:20.005300Z

Calva version 2.0.130 is out now in the VS Code marketplace. Jack-in should now work on Windows again. If you're using the open source version of vs code - "Code - OSS" the latest version there is still 2.0.129. The publish to Open VSX just started failing so we'll need to fix that in the CI.

1