Fork me on GitHub
#calva
<
2021-11-26
>
danp11:11:23

Hey all, just wondering what the standard way to ‘load’ a clj file into my nrepl in Calva. Currently I put the cursor at the bottom of the file at the root of the project (core, or whatever), and then evaluate to cursor. Is there an alternative method? Happy to do solely from the repl if that’s a more typical way to do it. It’s been a few years since I’ve touched Clojure, so I’m a little rusty!

pez11:11:24

Hi there! There is a dedicated command for this. Calva: Load Current File and Dependencies (I think it is, something like that anyway). Also, thanks for the tips about using of evaluate-to-cursor like that. Will save me some keystrokes, I often select to the start of the file and then if I am not careful, I loose track of where I were.

danp11:11:24

haha, thanks - you’re bang on with the command

danp11:11:52

I’ve also realised I can do (load "core") from the repl

danp11:11:02

it’s all coming back slowly - thanks again 🙂

pez12:11:00

Welcome back! I was probably not here when you left, so maybe I’m not the person to welcome you back. 😃 I hope Calva will treat you well!

🙏 1
mattford17:11:44

Hi, I've been trialling calva - in Emacs I'm able to run tests that look roughly like this

(deftest test-eligibility-check-submitted-event
  (harness/run {:commands [(harness/writer :a)
                           (harness/has-all-records? :b)]
                :assertions-fn (fn [journal]
                                 (let [records (get-in journal [:topics])]
                                   (testing "foo bar"
                                     (is (= 1 (count records))))}))

pez17:11:38

I don’t really understand the implications here. But, generally, I want Calva to handle the things CIDER handles (that’s why the name Calva), so an issue might be in place. However, this might be more general. We have many reports about “no tests found”. Please see if any issue on the repo might be already covering the problem before you file a new one. 😃

mattford17:11:11

I took a look - nothing leapt out at me

mattford17:11:14

How can I help provide more useful info?

mattford17:11:18

hmmm this seems intermittent

mattford17:11:58

really not sure what's going on

mattford17:11:06

I'll monitor over the weekend

🙏 1
mattford09:11:38

I think this maybe a PEBKAC!

mattford09:11:38

It's the difference between running CTRL-ALT-c CTRL-ALT-t and CTRL-ALT-c CTRL-t

mattford09:11:34

With the right invocation it works 🙂

pez09:11:14

I also get confused by those shortcuts. 😃

mattford17:11:14

However in Calva it reports no tests found.

mattford17:11:57

harness/run wraps the assertion fn which contains the "testing" macro

mattford17:11:01

Should this work?

mattford17:11:25

Or is this sort of thing not supported?

pez17:11:46

Friday reminder about reading the pinned items, dear Calva friends. 😃