Fork me on GitHub
#conjure
<
2020-07-04
>
Sergiusz Bleja12:07:47

I'm using the conjure dev shadow setup with the foo.cljs in the same repo. Run the ./nrepl-shadow.sh first and then started neovim. It seems like conjure assumes the n-repl connection is clojure. If I have the browser open on the page it sets it to clojurescript. Not sure whether this is default behaviour but it confused me quite a bit before I found a way around it.

Olical12:07:50

This is a shadow + nREPL specific behavior, if there's no ClojureScript runtime connected (like a browser) then you're basically in Clojure land still. I may be misunderstanding here, but are you saying the order in which you boot things up / connect determines if it's going to work or not?

Olical12:07:28

I tend to get shadow running my terminal, connect my browser, ensure it's all good and then connect Conjure when I know the nREPL server is all happy and connected.

👍 3
Olical12:07:52

If you want to reconnect you could try ,sQ to kill all sessions and then reconnect with :ConjureShadowSelect app

Sergiusz Bleja14:07:57

Ok, thanks for clarifying - it makes sense. I think my mental model sort of missed that the browser is the runtime in this case.

Olical14:07:57

Yup, it's conjure <-> shadow <-> browser, so if the browser isn't there, shadow has no CLJS. Shadow is the mediator between the browser's runtime and Conjure, Conjure never gets to talk to the browser directly. If that makes sense?

Sergiusz Bleja14:07:52

Yes, it does - nowhere to evaluate.

uwo14:07:41

I know this isn't conjure related, but how would y'all recommend making a binding that calls one of your own functions on the result of an evaluation?

Olical14:07:14

:thinking_face: you mean go and do an evaluation then call a function with the resulting string?

Olical14:07:43

Because there's support inside Conjure to do this since all evaluations in practice are async. So it needs to be callback based.

Olical14:07:39

I actually started writing up some docs for hooking into internal Conjure functions through Lua. This might be helpful https://github.com/Olical/conjure/wiki/Using-Conjure-programatically-(API)#evaluating-code

uwo14:07:13

Thanks!!

Olical14:07:05

I've pushed some new functionality to develop that the previous generation of Conjure had: Resolving of file paths on eval to be relative to your CWD. This means that you can use <localleader>ef on files from your local disk while evaluating on a remote server or inside a docker container that doesn't share the same absolute path.

Olical14:07:42

There's options to change the root it's resolved against in the case that your Neovim and JVM CWD are out of line as well as an option to turn this off entirely.

Olical14:07:39

It shouldn't be noticeable for the most part, but if you regularly evaluate files within docker containers etc then it should just start working! (once it's released)

Olical15:07:12

Another feature on develop! I've addressed https://github.com/Olical/conjure/issues/104 with these options: https://github.com/Olical/conjure/blob/ca7ad6b8bfd72c89512fee0b274e250754ea9dc3/doc/conjure-client-clojure-nrepl.txt#L157-L166 So data structures will be elided past a certain length or depth automatically (as long as you have pretty printing enabled, which is on by default). This should save you from accidentally printing the universe, I hope.

Olical15:07:43

Maybe the depth should be something more like 10-20. Any thoughts on these defaults (depth: 50, length: 500) is greatly appreciated!

Olical15:07:02

You can set them to false to remove these limits when required, but most people won't have to ever worry about this, I hope.

dharrigan18:07:56

I don't have any strong views on the defaults. Then again, I don't parse huge data structures atm 🙂

dave19:07:22

limiting by default sounds like a good idea to me!

dave19:07:38

as long as the limit is reasonably high that it doesn't feel like it will get in the way

dave19:07:49

and if it's configurable, that's even better