Fork me on GitHub
#calva
<
2018-11-26
>
pez08:11:28

I revived an un-pulled PR to the cljfmt project, that adds an option to have map items and bindings and such aligned in columns. Latest Calva Formatter has this as an experimental feature. Please try it out and let me know what you think! It doesn't always do the right thing, and works recursively so apply it with some precision.

slipset08:11:15

@pez There’s a discussion starting over at clojureverse wrt formatting that you might have interest in joining. Link in #clj-commons

pez08:11:07

Oh, I have missed that. Many thanks for heads up!

john15:11:19

Is there a write up on using calva without lein?

pez15:11:37

@john not that I know of. There is one for shadow-cljs, but I guess you are not using that either?

john15:11:48

Not at the moment. And I'm tackling a pure clojure (not clojurescript) project atm.

pez15:11:01

You sort of still need lein installed (unless you are using shadow). Just because I have been lazy with that.

pez15:11:31

I was able to use Calva with this test project. https://github.com/PEZ/deps-edn-figwheel Then lein is only used for connecting the Calvas terminal repls (`lein repl :connect`, not for managing the project in any way.

pez15:11:03

I intended to add a repl-y connect task to that project and rid Calva of the silly dependency on lein for connecting. But never did. Might be time to do that.

pez16:11:30

But if you have a command that connects with the only argument being host:port, then you can just change the Calva setting for the Connect REPL Command to that command and things should work.

pez16:11:00

(Should work even without lein installed, that is.)

lilactown17:11:51

the only dependency on lein is just having a way to start the nREPL server?

pez17:11:51

No, just having a way to connect a terminal session to the running nREPL server.

pez17:11:46

When Calva connects to the nREPL server it also opens up a Terminal session (in the VSCode built in terminal) and runs the command found in the setting for Connect REPL Command with host:port appended to it. This so that you can do stuff like evaluate current top level command in REPL Terminal.

pez17:11:16

And the default command is lein repl :connect, which accepts the argument of host:port.

pez17:11:55

I should find a way to better template that command.

lilactown17:11:22

hmm that's tricky to provide a cross-platform way to do that

lilactown17:11:37

like ideally you'd use the CLI tools (because most people should have them installed) but it wouldn't support windows 😭

pez17:11:08

Yeah, I can't solve all those things. But just have a smarter way to inject the host and port would help somewhat.

lilactown17:11:23

would including a jar with a REPL client help or hinder?

pez19:11:05

That could certainly be a way to do it. I think maybe that it could eat up memory if it fires up its own JVM?

lilactown19:11:23

I think lein repl :connect also starts it's own process?

slipset20:11:11

Don’t know why, but I’m trying what’s outlined here wrt starting nrepl with clj

slipset20:11:40

I manage to connect to the nrepl from Calva, but I get

slipset20:11:44

lein repl :connect localhost:50732
✔ ~/Documents/github.com/nrepl-clj
21:22 $ lein repl :connect localhost:50732
Connecting to nREPL at localhost:50732
CompilerException java.lang.ClassNotFoundException: clojure.tools.nrepl, compiling:(null:1:82)
#namespace[user]
Error loading namespace; falling back to user
nil
user=>

slipset20:11:53

in the calva repl terminal.

slipset20:11:23

{
 :aliases
 {:cider-clj {:extra-deps {org.clojure/clojure {:mvn/version "1.9.0"}
                           cider/cider-nrepl {:mvn/version "0.18.0"}}
              :main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}}

slipset20:11:00

I guess the reason why I’d want to try this out was to see if I could get Calva to run without lein.

pez22:11:44

Not sure, why the cider-nrepl link, @slipset?