Fork me on GitHub
#conjure
<
2021-05-24
>
harryvederci06:05:39

For those of you that use Telescope, I used Conjure to create a way to fuzzy find links in markdown files, and open them with any application you want to (default = open on macOS, x-www-browser otherwise). It's a first draft, but it works! 🙂 https://willfennel.com/posts/2021/05/23/neovim-telescope-markdown-link-handler.html (Sorry for the layout of that site, I created it this weekend and I'm still fixing stuff.)

Sigve06:05:27

I actually liked the simple layout 😅 Only thing missing for my part is a demo to get me hooked

harryvederci07:05:33

Yeah I still need to set up something like asciinema to create a demo, thanks for the feedback! Oh and I fixed the styling anyway 😛

🙂 3
Olical08:05:20

Ohhh interesting!

Santiago08:05:14

Do you need any new config to use the bb auto nrepl? I have 4.19.0 installed and it doesn’t auto start when I open a Clj file

Olical08:05:42

It's only on the develop branch for a little while to give people a chance to try it out before I force it on others 🙂 just in case it breaks some common essential workflow.

Olical08:05:59

It's also got a switch to turn it off completely, but I want to give it some trial time first.

Santiago09:05:25

ah got it! I’ll the dev branch then

dharrigan08:05:23

Are you on the dev branch of Conjure?

dharrigan08:05:05

Here it is working for me...

dharrigan08:05:05

I can't think of anything bad (!!!) to say about the babashka auto nrepl jack-in

dharrigan08:05:13

total :thumbsup: from me! 🙂

Olical08:05:17

Wonderful! Since I'm inserting it into an early common point of the workflow I was worried it'd break some users assumptions and config.

Olical08:05:40

Now I need to get babashka error output fixed over nREPL 😅 if you notice the errors are devoid of stack etc at the moment it's because bb doesn't give you any extra info over nREPL. Best short term solution is to evaluate *e which does contains the full details.

Olical08:05:51

I'm hoping to get the nrepl bb to enrich the error just like it does over stdio

dharrigan08:05:58

have you spoken with Michael about getting that info?

Olical08:05:08

Yep, issue raised in the bb.nrepl repo.

dharrigan08:05:42

I'll try it out more over the next few days, when working on my regular nrepl clj clojure projects 🙂

Olical08:05:59

You can also configure it to open a regular nREPL or run a script etc instead of bb 👀 it's basically auto jack-in, you'd probably want to configure that on a per directory basis though.

Niklas14:05:42

Is it possible to run the b test in this case with some key combination? <leader>tc only runs "a", which always reports "success":

(t/deftest a
  (t/deftest b
    (t/is (= 0 1))))

Olical19:05:16

Oh I didn't know that was possible! The current implementation hunts up to the root form for the test under the cursor. Maybe another mapping can be added that will do the current form, but that requires your cursor to be on the deftest b section, not a form below that. So given that caveat, do you think that'd do the trick for you?

Olical19:05:09

Hmm are you sure nested deftests make sense? Like you should never use a def below the top level of the namespace, and I thought that rule applied to deftest too? Are you sure you're not thinking of

(t/deftest foo
  (t/testing "something else" ...))

Niklas12:05:39

different use cases, nested deftests are for tests that share context, t/testing is for grouping asserts, see https://clojure.github.io/clojure/clojure.test-api.html

Niklas12:05:34

It does seem strange to me, like running b should run everything in a up to b.. I'm thinking about forbidding nesting of tests in my current project instead

Olical12:05:49

I've never personl

Olical12:05:19

I've never personally seen a nested deftest in years of professional Clojure 😅

Niklas12:05:10

yeah, it doesn't seen necessary... or maybe it doesn't even work with the cognitect test runner? I don't know

Niklas12:05:25

I just played with it in vim 😛

Niklas12:05:02

I see the difference now, the subtests are executed in the supertest, not defined. My bad

Niklas12:05:10

(deftest a
  (is (= 0 1)))

(deftest b
  (a))

Niklas14:05:42

AFAIU you should be able to nest tests, see the docs here: https://clojure.github.io/clojure/clojure.test-api.html

GitHub19:05:58

[Olical/conjure] Pull request opened by nbardiuk

Lance Erickson20:05:38

Greetings! Extremely noob question here, thanks for even bothering to read it. I’m playing around with conjure and stumbling over namespaces. I’ve been starting nREPL like

clj -m nrepl.cmdline \
    --middleware "[cider.nrepl/cider-middleware]" \
    --interactive
in my project root. Then I go edit ./src/foo.clj which begins with (ns foo). When I make some functions with defn and attempt to call them , eg
(defn can-mirror? [part]
  (clojure.string/starts-with? (:name part) "left-"))

(can-mirror? {:name "left-foot"})

Lance Erickson20:05:06

conjure tells me it can’t find can-mirror? in this namespace…. if I require '[foo] into the user namespace in my running repl, everything becomes happy… but I feel like there is something obvious about this that I am just missing. How to change the repl namespace from within neovim, I suppose, is the succinct thing to ask.

Lance Erickson20:05:56

And then I see that foo is probably a malformed namespace. This has been another episode of Extreme Public Rubber Ducking.