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)
2020-09-26T16:22:00.020100Z

I often have two sessions running at once, one for Clojure and another for ClojureScript. Is there some way to run ConjureEval such that it, say, always targets a Clojure session regardless of the current file or active session?

Olical 2020-09-28T13:16:00.022Z

Hmm you could definitely have something custom that plugs into Conjure's internals. You could call into this function (which you can totally require and access from any lua!) https://github.com/Olical/conjure/blob/a9431410d74f2281ae626727342a5d23d4a12552/fnl/conjure/client/clojure/nrepl/server.fnl#L160-L179 It calls a callback with every current session and their type (clojure / clojurescript). You could then work out if you need to hop sessions or not and then call assume-session if you want to https://github.com/Olical/conjure/blob/a9431410d74f2281ae626727342a5d23d4a12552/fnl/conjure/client/clojure/nrepl/server.fnl#L69-L72 Then do your eval and hop back if you wanted to. It's pretty custom but the behaviour you want is pretty custom I guess. This could totally be another plugin that piggybacks on Conjure, that way you get a nice plugin that adds exactly what you want and others can use it too if they so choose 🙂 or just add it to your dotfiles / config, that'll work great too!

Olical 2020-09-28T13:17:44.022400Z

Just bear in mind that these internals functions might move slightly over time so remember to pin Conjure to a tag and subscribe to releases so you don't get surprised! I don't plan on ever removing these or changing them right now. The only thing I'm thinking about is when I refactor the nREPL client code out into a reusable module for other languages to use (Racket, vanilla Fennel in another Lua process etc) I might move those ...nrepl.server contents to some other name, maybe not though!

Olical 2020-09-28T13:19:13.022600Z

Also thank you SO SO much for the sponsorship, it means so much to me. I'm getting ever closer to requiring less work for other peoples ideas / companies and closer to building the tools I love and believe in for you while also being able to pay my bills.

2020-09-28T15:47:52.022800Z

My pleasure. Conjure is super helpful to me and I know you pour a ton of work into it.

2020-09-26T16:23:05.021Z

My objective is to have a suite of project-specific tools, e.g. to re-start the web server.

Olical 2020-09-26T16:27:27.021100Z

Not right now no, maybe with some significant hacking? I'd recommend playing with custom mappings to see if you can get what you want

2020-09-26T16:57:55.021300Z

Not really a big deal. I just gotta check if I’m in the right kind of session. Maybe I’ll just put a check in the tool so it can print an error if it’s not in the right environment. Thanks.