Fork me on GitHub
#calva
<
2019-05-22
>
pez06:05:57

Good point. There should at least be a way to opt out.

danlucraft10:05:14

Hello, just trying to get Calva working in a Clojure project that’s using deps. From here (https://github.com/BetterThanTomorrow/calva/wiki/Getting-Started) I think I have to have this in my deps.edn

{:repl {:plugins [[cider/cider-nrepl "0.21.2-SNAPSHOT"]]
        :dependencies [[nrepl "0.6.0"]]}}
But then what terminal command is used to run the repl?

danlucraft10:05:02

Ohh this is a lein thing for profiles.clj :woman-facepalming:

danlucraft10:05:25

The closest I’ve come is using this deps.edn:

:aliases
 {:cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "0.21.2-SNAPSHOT"}}
              :main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}}
and running with clj -A:cider-clj. That allows me to connect from the editor, but then this happens:

pez10:05:32

Have you evaluated the file before that? (Not sure why that would help, but I have seen this before...)

danlucraft10:05:33

No, i hadn’t. I just did though, and then (+ 1 2) worked after that

danlucraft10:05:24

The :require directive doesn’t include clojure.core though, so why would that help?

danlucraft10:05:54

Ok, new info: - if I open a blank clojure file and put (+ 1 2) in it, it works right away - but in this existing clojure file that has an ns and requires a bunch of stuff, it doesn’t work unless the whole file has been evaled beforehand

danlucraft11:05:31

@U0ETXRFEW Does that look like the correct way to run nrepl at the top of this thread?

pez11:05:15

I haven't quite understood it either, but I think that the system (the app, or how it should be understood) does not know about anything until it has loaded some code. Loading that file with an ns causes it to get ”woke” about clojure.core and things. But that file without an ns form gets evaluated in the user name space, which is magic, haha.

pez11:05:30

Yeah, that looks right. If you like you can try the alpha-build of Calva 2, which has support for cli/deps and does something similar to that to fire things up.

danlucraft11:05:50

@U0ETXRFEW OK, weird 🙂 Sure, would love to give it a go. Is there an explanation anywhere for how to run it (bit of a Clojure noob here)?

pez11:05:14

It's a bit of vscode knowledge needed, rather. You'll find a VSIX package in the alpha-build dir of the dev branch at Github. Download that. Then in the vscode extensions pane use the small ... menu and choose Install from VSIX. I'd love to get some feedback on how it works. Trying to get it releasable within the following two weeks.

danlucraft11:05:23

OK, I’ll give it a go 🙂

danlucraft11:05:21

@U0ETXRFEW Just continuing this exploration, even though I can now evaluate (+ 1 2) (after setting the namespace), I still can’t do (doc +), and instead have to do (clojure.repl/doc +) How would you suggest loading the clojure.repl symbols into the current namespace? I thought evaluating (use clojure.repl) would do it but apparently not

pez12:05:13

Hmmm, that's a bit strange. Can you file it as an issue so that I can keep track of it?

pez12:05:31

(Also, you should have docs on hover, do you?)

danlucraft13:05:12

>Can you file it as an issue so that I can keep track of it? Can do

danlucraft13:05:41

> (Also, you should have docs on hover, do you?) This was something else I meant to ask you about. I have docs on hover and click to definition, but only for fully namespaced symbols.

danlucraft13:05:09

That’s including for stuff defined in my own project and for stuff in clojure.core

pez13:05:08

Ask about it out in the channel. I'll be offline a while now, but maybe someone else can help.

danlucraft10:05:28

(That also gives a bunch of warnings about “An illegal reflective access operation has occurred”)

orestis10:05:22

These you can safely ignore for now (for a few years at least). It’s an issue with some libraries that aren’t fully compatible with the latest JVM, but they still work.

danlucraft10:05:35

Hmm, ok then!

orestis10:05:39

Unfortunately can’t help much with the other thing 😞

danlucraft10:05:17

Thanks anyway 🙂