conjure

:neovim:+:clj: https://github.com/Olical/conjure - If you're enjoying Conjure and want to say thanks: https://github.com/users/Olical/sponsorship :smile: (alt https://conjure.fun/discord)
harryvederci 2021-05-24T06:43:39.045200Z

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.)

harryvederci 2021-05-24T07:04:33.045900Z

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 ๐Ÿ˜›

๐Ÿ™‚ 1
Olical 2021-05-24T08:32:20.048400Z

Ohhh interesting!

Sigve 2021-05-24T06:53:27.045300Z

I actually liked the simple layout ๐Ÿ˜… Only thing missing for my part is a demo to get me hooked

Santiago 2021-05-24T08:21:14.047100Z

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

dharrigan 2021-05-24T08:23:23.047300Z

Are you on the dev branch of Conjure?

dharrigan 2021-05-24T08:27:05.047600Z

Here it is working for me...

dharrigan 2021-05-24T08:27:17.047700Z

Olical 2021-05-24T08:31:42.048Z

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.

Olical 2021-05-24T08:31:59.048200Z

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

dharrigan 2021-05-24T08:34:05.049100Z

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

dharrigan 2021-05-24T08:34:13.049300Z

total :thumbsup: from me! ๐Ÿ™‚

Olical 2021-05-24T08:37:17.050200Z

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.

Olical 2021-05-24T08:38:40.051500Z

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.

Olical 2021-05-24T08:38:51.051900Z

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

dharrigan 2021-05-24T08:38:58.052100Z

have you spoken with Michael about getting that info?

Olical 2021-05-24T08:39:08.052400Z

Yep, issue raised in the bb.nrepl repo.

dharrigan 2021-05-24T08:40:20.052600Z

scweeet

dharrigan 2021-05-24T08:40:42.053100Z

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

Olical 2021-05-24T08:44:59.054100Z

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.

Santiago 2021-05-24T09:00:25.054200Z

ah got it! Iโ€™ll the dev branch then

Niklas 2021-05-24T14:30:42.056Z

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))))

Niklas 2021-05-25T12:44:39.068100Z

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

Niklas 2021-05-25T12:45:34.068300Z

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

Olical 2021-05-25T12:45:49.068500Z

I've never personl

Olical 2021-05-25T12:46:19.068800Z

I've never personally seen a nested deftest in years of professional Clojure ๐Ÿ˜…

Niklas 2021-05-25T12:49:10.069Z

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

Niklas 2021-05-25T12:49:25.069200Z

I just played with it in vim ๐Ÿ˜›

Niklas 2021-05-25T12:56:02.069400Z

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

Niklas 2021-05-25T12:56:10.069600Z

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

(deftest b
  (a))

Niklas 2021-05-24T14:32:42.056400Z

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

Olical 2021-05-24T19:18:16.056600Z

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?

Olical 2021-05-24T19:20:09.056800Z

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" ...))

2021-05-24T19:28:58.057Z

[Olical/conjure] Pull request opened by nbardiuk

Lance Erickson 2021-05-24T20:31:38.060500Z

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 Erickson 2021-05-24T20:36:06.063200Z

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 Erickson 2021-05-24T20:44:56.063900Z

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