calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
jlmr 2021-02-21T15:55:21.012900Z

Hi, I’m just starting out with Calva, it looks great so far! I’m trying to get Calva to open reveal automatically once I jack-in, but I can’t get it working. I’ve added an alias to my .clojure/deps.edn as described here: https://calva.io/reveal/#use-reveal-nrepl-middleware When I jack-in and select the reveal-nrepl-middleware alias, the reveal window does not appear. I’ve also tried adding (do (require '[vlaaad.reveal]) (vlaaad.reveal/ui)) to afterCLJReplJackInCode . This opens the reveal window automatically, but evaluated expressions do not appear in the reveal window. Any tips?

jlmr 2021-02-22T08:08:29.033200Z

clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.8.3"},cider/cider-nrepl {:mvn/version,"0.25.8"}}}' -A:add-libs:reveal-nrepl-middleware:dev -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
WARNING: When invoking clojure.main, use -M
nREPL server started on port 49526 on host localhost - <nrepl://localhost:49526>
This is the output I’m getting. No errors, but I do see a WARNING about invoking clojure.main

bringe 2021-02-22T17:39:20.039700Z

I see. What about in the output.calva-repl window?

jlmr 2021-02-23T19:38:57.050800Z

A I think I see the error: ; Starting Jack-in Terminal: clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version,"0.8.3"},cider/cider-nrepl {:mvn/version,"0.25.8"}}}' -A:add-libs:reveal-nrepl-middleware:dev -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]" The --middleware is different from what I have in the reveal-nrepl-middleware alias in my deps.edn:

:reveal-nrepl-middleware {:extra-deps {vlaaad/reveal {:mvn/version "RELEASE"}}
     				      :main-opts  ["-m" "nrepl.cmdline"
                  					   "--middleware" "[vlaaad.reveal.nrepl/middleware,cider.nrepl/cider-middleware]"]
                  		  :jvm-opts ["-Dvlaaad.reveal.prefs={:font-size,14,:theme,:light}"]}
Could it be that Calva overwrites this setting somewhere?

bringe 2021-02-23T23:11:22.051Z

Hmm. Is that in your project deps.edn or ~/.clojure/deps.edn? Not sure if that matters here, but @pez probably knows more about this middleware thing.

jlmr 2021-02-24T13:22:55.051700Z

This is in my ~/.clojure/deps.edn there are no conflicting aliases in my project deps.edn

jlmr 2021-02-24T13:23:19.051900Z

@brandon.ringe Might be better if I file an issue on Github I guess?

pez 2021-02-24T13:33:35.052100Z

There are some (closed) issues there already. Maybe you can find some help there. Just a moment.

pez 2021-02-24T13:34:46.052300Z

This is the one I was thinking about: https://github.com/BetterThanTomorrow/calva/issues/1032

bringe 2021-02-24T17:04:22.065800Z

If info from that issue doesn't help, please file a new one.

bringe 2021-02-24T17:05:43.066Z

@pez Will jack-in use the middleware from the :main-opts of an alias, or is it required to start the repl manually then connect?

pez 2021-02-24T17:41:55.072400Z

If Calva knows that an alias provides main-opts then it won’t use the default middleware. That would mean that for @jlmr’s jack-in to work, the alias needs to be in the projects deps.edn file. (Calva does not read user deps.edn files.)

👍 1
pez 2021-02-24T17:43:18.073500Z

@jlmr file an issue about this, I think. We should either document this clearly or add functionality to Calva to handle this more directly.

jlmr 2021-02-25T10:17:58.095700Z

@pez issue added https://github.com/BetterThanTomorrow/calva/issues/1045 !

👍 2
bringe 2021-02-21T20:30:20.013800Z

I haven't used reveal, but do you see any errors in the repl output? Feel free to create an issue with repro steps and details like your OS, JDK version, and Calva version so we can investigate.

pez 2021-02-21T20:51:22.017200Z

New attempt to get deps.edn jack-in work on Windows even when Calva is run from a path containing spaces. @cb.lists And if other windows users want to help test it as well, that would be swell. deps.edn jack-in and the standalone repl starts should both still work, or I have broken something: https://11520-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.173-814-connect-without-project-f25a7680.vsix

pez 2021-02-21T23:08:40.021500Z

New version of Calva just released, with this content: • Fix https://github.com/BetterThanTomorrow/calva/issues/814https://github.com/BetterThanTomorrow/calva/issues/1003https://github.com/BetterThanTomorrow/calva/pull/981, thanks @plexus! Please try the Standalone REPL thing and let me know if there are problems with it. Same with the standalone connect. Both should work without any project opened. (The Getting Started stuff I’ve been posting about is not part of this release.)

pez 2021-02-21T23:11:15.021600Z

This should fix the story with starting up a Calva REPL as easy as a prompt REPL, @alexmiller, and also lays the foundation for taking that experience a step further, which is work in progress.

metehan 2021-02-21T23:12:44.022200Z

I couldn't find documentation about "calva.jackInEnv": {  } settings

metehan 2021-02-21T23:14:08.022700Z

actually I am looking a way to make this default

pez 2021-02-21T23:18:46.023Z

This is all documentation there is about it: https://calva.io/connect/#customizing-jack-in Maybe a bit scarce, but I’m not sure what more there is to say about it…

1
alexmiller 2021-02-21T23:19:08.023300Z

:thumbsup:

pez 2021-02-21T23:19:10.023500Z

Default how?

pez 2021-02-21T23:20:31.023700Z

Easiest way to connect to a running project repl is to use that commad directly. Default keyboard shortcut is ctrl+alt+c ctrl+alt+c.

metehan 2021-02-21T23:30:36.024Z

everytime I connect to repl I need to answer same questions and like last 9 months I never chosed something else. so I thought maybe there is a way to chose them by default and with one click I can connect to repl

metehan 2021-02-21T23:32:26.024200Z

ctrl+alt+c ctrl+alt+c is nice but how about next questions lets say can I just make "app" default or "shadow-cljs"

metehan 2021-02-21T23:32:34.024400Z

metehan 2021-02-21T23:32:52.024800Z

metehan 2021-02-21T23:33:21.025200Z

metehan 2021-02-21T23:34:26.025600Z

I think it would be amazing If I can create project settings "default repl method" and connect to repl with one shortcut

pez 2021-02-21T23:35:56.025900Z

That’s what the custom connect sequences are for: https://calva.io/connect-sequences/

pez 2021-02-21T23:51:19.027100Z

And about that Getting Started REPL, here’s the PR to follow for that: https://github.com/BetterThanTomorrow/calva/pull/1041

pez 2021-02-22T09:20:18.033800Z

Maybe the file got corrupted in your download @m373h4n. I just tried it (on Mac, but anyway) and vscode happily just uses it.

metehan 2021-02-22T22:27:11.041800Z

again I got Element 'Identity' has invalid value for attribute 'Version' ---&gt; System.FormatException: Input string was not in a correct format. but np I'll wait normal release 🙂

pez 2021-02-23T08:45:46.042Z

Frustrating. I was hoping to get a tester on the new feature. I’ll post a new VSIX link and maybe that one will work.

pez 2021-02-21T23:54:17.027300Z

Here is the v2.0.174 prerelease VSIX with this feature enabled: https://11561-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.174-1040-getting-started-repl-c61e5e6e.vsix