Fork me on GitHub
#calva
<
2021-02-21
>
jlmr15:02:21

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?

bringe20:02:20

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.

jlmr08:02:29

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 - 
This is the output I’m getting. No errors, but I do see a WARNING about invoking clojure.main

bringe17:02:20

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

jlmr19:02:57

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?

bringe23:02:22

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

jlmr13:02:55

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

jlmr13:02:19

@U9A1RLFNV Might be better if I file an issue on Github I guess?

pez13:02:35

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

bringe17:02:22

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

bringe17:02:43

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

pez17:02:55

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

👍 3
pez17:02:18

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

pez20:02:22

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

pez23:02:40

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.)

pez23:02:15

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

metehan23:02:44

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

pez23:02:46

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…

parens 3
metehan23:02:08

actually I am looking a way to make this default

pez23:02:10

Default how?

pez23:02:31

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.

metehan23:02:36

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

metehan23:02:26

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

metehan23:02:26

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

pez23:02:56

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

pez23:02:19

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

metehan00:02:06

this zip doesn't contain .vsix file do I do something wrong ?

bringe00:02:18

Clicking that link above should download a .vsix file for you. It did for me. Does it not for you?

metehan00:02:56

I got a zip: calva-2.0.174-1040-getting-started-repl-c61e5e6e.zip

metehan00:02:11

I've manually convereted .zip to .vsix I got an error

pez00:02:27

Converted?

metehan00:02:07

I mean just changed extension (converted was wrong word)

pez00:02:12

You should get away with just changing the file extension.

pez00:02:30

What was the error you got?

pez00:02:30

Strange. I'm afk and can't test this myself. Let's see if someone else can. Never had that happen before...

✔️ 3
seancorfield02:02:05

@UJ35GLZU7 I just downloaded that on Windows, got the zip, changed .zip to .vsix, and then in VS Code > Extensions > ... > Install from VSIX... and selected the newly renamed .vsix file and it installed fine for me.

❤️ 3
pez09:02:18

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

metehan22:02:11

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

pez08:02:46

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.