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)
Chase 2021-01-16T00:56:44.017100Z

Funny story, I went searching for a scheme plugin and stumbled on this one https://github.com/Olical/vim-scheme by guess who? Hahaha. And he created it to use while working through SICP. Well played @olical

Olical 2021-01-16T01:21:40.017700Z

Haha, I am aiming for conjure to massively deprecate that plugin :) but if it works, yay!

Olical 2021-01-16T01:22:41.018700Z

And @chase-lambert @dave you can configure the racket repl startup options, see the racket specific help :D

Olical 2021-01-16T01:22:52.019100Z

There's an option for the command it invokes

Chase 2021-01-16T01:25:45.020400Z

Cool, I will look into that tomorrow. I don't mind using this old scheme tool of yours either though. It is funny seeing the mix of fireplace shortcuts and what were probably your first ideas of conjure commands mixed together

Olical 2021-01-16T12:39:27.021600Z

Yeah I'm sure there's some precursor ideas before Conjure plopped into my head 😄 it's also what made me realise how difficult it is to do that sort of thing in VimL, so probably helped kick me towards Aniseed. It may have been the last VimL plugin I tried to write :thinking_face: wondering how much better I could write https://github.com/Olical/vim-enmasse/ now too!

martinklepsch 2021-01-16T12:48:03.022700Z

Does Conjure support some sort of jump-to-var type thing?

Olical 2021-01-16T12:48:15.022900Z

Yup, for Clojure at least

Olical 2021-01-16T12:48:20.023300Z

<prefix>gd

Olical 2021-01-16T12:48:41.024100Z

It's not on gd (unprefixed) because that can be handy for jumping to files etc and I didn't want to hide core nvim functionality.

martinklepsch 2021-01-16T12:48:47.024300Z

Oh, I actually meant more based on a fuzzy search than whats under the cursor

martinklepsch 2021-01-16T12:48:54.024500Z

sorry, wasn’t very clear 😅

martinklepsch 2021-01-16T12:49:07.024900Z

Like I’d like to use FZF to search for vars in my codebase

Olical 2021-01-16T12:49:27.025600Z

Oh :thinking_face: so listing every var in the system

martinklepsch 2021-01-16T12:49:43.026Z

currently I use ripgrep and then just def thing-im-looking-for

martinklepsch 2021-01-16T12:49:58.026400Z

but I think it might be nice to just give a fuzzy search across vars

martinklepsch 2021-01-16T12:50:11.026900Z

another thing where clj-kondo static analysis could shine

Olical 2021-01-16T12:50:38.027500Z

I mean, this wouldn't be core conjure functionality because it assumes a few other plugins, but it could be an extra thing / a recipe we work out that others can paste into their config.

Olical 2021-01-16T12:50:53.028Z

I think we could query the REPL for every var currently loaded

martinklepsch 2021-01-16T12:51:23.028500Z

personally I’m more interested in the static analysis approach because I mostly do cljs and am not always connected to a REPL

martinklepsch 2021-01-16T12:51:48.029200Z

but fair point with involving other plugins for sure

martinklepsch 2021-01-16T12:52:00.029600Z

I’m gonna take a look if I can hack this together

Olical 2021-01-16T12:52:04.029800Z

Hmm does LSP support this through clojure-lsp then?

Olical 2021-01-16T12:52:16.030100Z

Feels like a great candidate for that

martinklepsch 2021-01-16T12:52:27.030700Z

I haven’t tried that. Are you using clojure-lsp with Conjure?

martinklepsch 2021-01-16T12:52:50.031600Z

I’m still a bit burned from years ago when all these plugins would conflict in one war or the other

Olical 2021-01-16T12:52:53.031800Z

I am still kinda trying to keep Conjure clear cut in that it's all about sending code to a process for evaluation then doing something with the result from your live system. Less about analysing code on disk.

Olical 2021-01-16T12:52:58.032100Z

And nope, never have

Olical 2021-01-16T12:53:00.032300Z

I only use Conjure

Olical 2021-01-16T12:53:03.032500Z

+ fzf + rg

Olical 2021-01-16T12:55:22.032900Z

(map second (mapcat ns-interns (all-ns))) so that's every var in my project

Olical 2021-01-16T12:56:24.033800Z

clojure
{:private true,
 :arglists ([code line column]),
 :line 42,
 :column 1,
 :file "nrepl/middleware/interruptible_eval.clj",
 :name source-logging-pushback-reader,
 :ns #namespace[nrepl.middleware.interruptible-eval]}
Each of which is a var, so you can get source metadata

Olical 2021-01-16T12:56:38.034200Z

So this could be mapped into a list filtering plugin, 100% 🙂

Olical 2021-01-16T12:57:15.035Z

YMMV in CLJS land, but it may well work. I know var location metadata can be very flaky in CLJS, which is why I relied on nREPL and it's info op.

2021-01-16T13:02:04.035200Z

2021-01-16T13:58:33.035300Z

2021-01-16T13:58:34.035400Z

2021-01-16T13:58:34.035500Z

2021-01-16T13:58:41.035600Z

2021-01-16T13:58:51.035700Z

dharrigan 2021-01-16T21:19:17.035900Z

Oh-oh

dharrigan 2021-01-16T21:19:20.036100Z

Error executing vim.schedule lua callback: /home/david/.vim/bundle/conjure/lua/conjure/log.lua:400: Conjure failed to append to log: String cannot contain newlines

dharrigan 2021-01-16T21:19:29.036300Z

Just updated

Olical 2021-01-16T21:20:21.036900Z

Well that's weird... I didn't change anything that would effect that :thinking_face: I'll try and reproduce this tomorrow

dharrigan 2021-01-16T21:22:09.037300Z

One of my require's had a require that didn't compile

dharrigan 2021-01-16T21:22:38.037900Z

thus when that failed (and caused the particular namespace I was evalling a buffer on to fail), caused this

Olical 2021-01-16T21:26:00.038500Z

Ah okay! This sounds like something that has been around for a while then!

Olical 2021-01-16T21:26:07.038800Z

Thanks, I'll fix this and release it tomorrow

Olical 2021-01-16T21:26:32.039300Z

So I need a require to fail in a namespace?

Olical 2021-01-16T21:26:41.039700Z

If you can repro it again that'd be amazing

dharrigan 2021-01-16T21:29:12.040300Z

I'll see if I can reproduce this, but in all honesty, this is the first time I've seen this

dharrigan 2021-01-16T21:29:24.040700Z

I'm assuming it's what I said, but needs me to reproduce it again 🙂

Olical 2021-01-17T10:50:03.040800Z

Hmm I tried to require a file that required another file that had invalid syntax but it worked (as much as you'd expect it to) :thinking_face: not sure if I can repro, I'll read the code and see if I can spot any place a newline could slip through.

Olical 2021-01-17T10:50:16.041Z

Maybe your Clojure is adding new lines into an error message that I never expected or something.

Olical 2021-01-17T10:52:47.041200Z

Oh! Actually! The next line after that error should have been the offending lines that caused the issue! Did you see any? It'd be in :messages if not I guess.

dharrigan 2021-01-17T11:12:22.041400Z

Unfortunately, no longer exists. I'll keep an eye and report if it happens again.

Olical 2021-01-17T11:13:26.041600Z

:thinking_face: I'm considering putting a guard in, but I try to avoid regexing strings and mapping over every line I'm logging wherever possible. I don't want do too much processing to each line so when you print a 10k line data structure it actually displays within a few seconds.

Olical 2021-01-17T11:14:15.041800Z

However, this might be good, I'm considering replacing \n with a ↵

Olical 2021-01-17T11:14:31.042Z

They shouldn't ever get through, but at least the line will still display if it does.

Olical 2021-01-17T11:18:18.042200Z

Pushed a patch to develop that does this. Now if I spot a ↵ I'll know there's a case where a new line can slip through.