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.)
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 ๐
Ohhh interesting!
I actually liked the simple layout ๐ Only thing missing for my part is a demo to get me hooked
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
Are you on the dev branch of Conjure?
Here it is working for me...
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.
It's also got a switch to turn it off completely, but I want to give it some trial time first.
I can't think of anything bad (!!!) to say about the babashka auto nrepl jack-in
total :thumbsup: from me! ๐
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.
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.
I'm hoping to get the nrepl bb to enrich the error just like it does over stdio
have you spoken with Michael about getting that info?
Yep, issue raised in the bb.nrepl repo.
scweeet
I'll try it out more over the next few days, when working on my regular nrepl clj clojure projects ๐
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.
ah got it! Iโll the dev branch then
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))))
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
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
I've never personl
I've never personally seen a nested deftest in years of professional Clojure ๐
yeah, it doesn't seen necessary... or maybe it doesn't even work with the cognitect test runner? I don't know
I just played with it in vim ๐
I see the difference now, the subtests are executed in the supertest, not defined. My bad
(deftest a
(is (= 0 1)))
(deftest b
(a))
AFAIU you should be able to nest tests, see the docs here: https://clojure.github.io/clojure/clojure.test-api.html
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?
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" ...))
[Olical/conjure] Pull request opened by nbardiuk
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"})
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.
And then I see that foo
is probably a malformed namespace. This has been another episode of Extreme Public Rubber Ducking.