Fork me on GitHub
#conjure
<
2021-01-16
>
Chase00:01:44

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

Olical01:01:40

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

Olical01:01:41

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

Olical01:01:52

There's an option for the command it invokes

Chase01:01:45

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

Olical12:01:27

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!

martinklepsch12:01:03

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

Olical12:01:15

Yup, for Clojure at least

Olical12:01:20

<prefix>gd

Olical12:01:41

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.

martinklepsch12:01:47

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

martinklepsch12:01:54

sorry, wasn’t very clear 😅

martinklepsch12:01:07

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

Olical12:01:27

Oh :thinking_face: so listing every var in the system

martinklepsch12:01:43

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

martinklepsch12:01:58

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

martinklepsch12:01:11

another thing where clj-kondo static analysis could shine

Olical12:01:38

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.

Olical12:01:53

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

martinklepsch12:01:23

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

martinklepsch12:01:48

but fair point with involving other plugins for sure

martinklepsch12:01:00

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

Olical12:01:04

Hmm does LSP support this through clojure-lsp then?

Olical12:01:16

Feels like a great candidate for that

martinklepsch12:01:27

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

martinklepsch12:01:50

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

Olical12:01:53

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.

Olical12:01:58

And nope, never have

Olical12:01:00

I only use Conjure

Olical12:01:03

+ fzf + rg

Olical12:01:22

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

Olical12:01:24

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

Olical12:01:38

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

Olical12:01:15

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.

dharrigan21:01:20

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

dharrigan21:01:29

Just updated

Olical21:01:21

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

dharrigan21:01:09

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

dharrigan21:01:38

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

Olical21:01:00

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

Olical21:01:07

Thanks, I'll fix this and release it tomorrow

Olical21:01:32

So I need a require to fail in a namespace?

Olical21:01:41

If you can repro it again that'd be amazing

dharrigan21:01:12

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

dharrigan21:01:24

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

Olical10:01:03

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.

Olical10:01:16

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

Olical10:01:47

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.

dharrigan11:01:22

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

Olical11:01:26

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

Olical11:01:15

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

Olical11:01:31

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

Olical11:01:18

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.