Fork me on GitHub
#conjure
<
2020-04-16
>
Olical10:04:21

Completion is 100% on the way, I'll elaborate on how I think I'll do it too.

Olical10:04:44

I'd love pretty printing, I think that may be more of an nREPL thing than a Conjure thing at his point, I'll have a google!

Olical11:04:17

I'm trying to see if CIDER provides good pretty print out of the box :thinking_face: also on the fence about using CIDER, it does provide a bunch of good stuff. I could lean on it for autocompletion etc, so if you didn't have it you could still eval you just lose some features.

dave14:04:05

is autocompletion part of orchard? that might make it a bit more palatable

Olical14:04:37

I think so? I still don't understand orchard, is it just a dep you add to your project then all clients use it?

Olical14:04:57

I'm hoping to find something that's well maintained and shared for this sort of thing before I implement it myself again.

dave14:04:14

my understanding is that orchard is a library(?) of logic extracted out of cider so that it can be used in other contexts

Olical14:04:34

Ah I see. Maybe I'd still need to sideload it in, but that's not so bad.

nate15:04:48

I think leveraging cider is a good idea

nate15:04:01

and falling back to just supporting eval if it's not present

nate15:04:33

I figured that pretty printing would be a cider thing

nate15:04:44

or at least an "easier to do with cider" thing

nate15:04:32

another option is to shell out to something that can pretty print

Olical15:04:22

Yep, I think it'll be cool to lean on all of that work. I just worry some people will be turned off by that. I've been burned by CIDER versions drifting before where fireplace or emacs wouldn't work on different versions. So my colleague and I had to keep fiddling to keep our different environments working.

Olical15:04:27

But I think it's better now

Olical15:04:31

And some of that may have been fireplace

Olical15:04:48

Maybe, although probably no one things fault, just a perfect storm of shifting code.

Olical15:04:12

And yeah, I think pretty print will be super easy with CIDER but also nREPL should get a pprint wrapper soon that makes it really easy for me.

Olical15:04:18

In the mean time I know a way to get around it.

Olical15:04:20

Might add pp now

sogaiu00:04:25

imo, it's good to have the option to easily "not load stuff into my running process" especially when investigating issues in one's codebase.

Olical11:04:45

Or I try to do my own stuff entirely and just sideload dependencies. Although sideloading might not work with babashka nREPL? (@borkdude)

borkdude11:04:29

@olical I haven't looked into side-loading operations. I'm a bit unclear about what it's all about

Olical12:04:19

Ah okay, no problem! It's basically a way to say "hey, if someone tries to load a class and you don't have it, ask me" then the client can provide the required classes. This is all to do with JVM class loaders, it'll just be something clients will have to be careful with since some nREPL servers won't have sideloading.

Olical12:04:26

So features will need to be detected and turned off.

borkdude12:04:29

babashka is a closed world when it comes to classes, you can't dynamically add classes

borkdude12:04:56

you can however add sources to the classpath dynamically

Olical12:04:57

Yep, completely expected.

Olical12:04:57

I was trying to be clever with "test this namespace" and have it add a -test suffix to the namespace if there wasn't one or take it away if there was. So the -test and non -test variants of the namespace would both be run. This causes a bunch of issues in CLJS land which sucks. I'll keep it simple and only run the tests for the namespace you're in for now.

Olical12:04:21

Maybe this function could be under to like test other namespace, or tN.

Olical12:04:38

But by default it only does the one you're in.

Olical12:04:14

Yep, done like that for now. tn is namespace, tN is alternate namespace. It'll either remove the -test suffix from your current one and do that or the other way around.

Olical12:04:23

Saves you hopping between buffers to run them.

Olical12:04:40

Next step is "eval the test my cursor is on", but I might refactor how results are displayed from these actions first :thinking_face:

Olical12:04:46

But first, lunch and coffee!

Olical15:04:26

https://asciinema.org/a/JhC1t9tAptOFmifRTuRAlIM3T CLJS is probably wonky but you can now test the form under your cursor!

Olical15:04:23

I think I want to test ClojureScript support against Shadow or Figwheel's CLJS nREPL instead of the piggieback I have right now. I think they're far more representative of how people actually work on CLJS.

dave15:04:50

i have noticed a lot of people using shadow-cljs

dave15:04:10

it's what i think i would try the next time i start a cljs project

Olical16:04:26

Yep, same. That and figwheel seem defacto.

Olical16:04:50

Cool, pretty printing via clojure.pprint working! And you can turn it off with :ConjureConfig clojure.nrepl/eval.pretty-print? false if you so choose.

aw_yeah 2
Olical16:04:15

Pushed now.

Olical16:04:19

So unless anyone has any major gripes with them, testing is done (for now) and so is pretty printing.

🎉 3
Olical16:04:41

Namespace refreshing and completion may require an optional CIDER dep but we'll see :thinking_face:

Olical16:04:49

Might even get a debugger if we lean on CIDER 😬

Olical16:04:53

How mad would that be

Olical16:04:48

Oh and I want to get stdin prompting working, so if something needs stdin Neovim will prompt you for it.

Olical16:04:58

I think nREPL supports that.

dominicm16:04:43

It's a status type