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?
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!
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!
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.
My pleasure. Conjure is super helpful to me and I know you pour a ton of work into it.
My objective is to have a suite of project-specific tools, e.g. to re-start the web server.
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
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.