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?
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.mainI see. What about in the output.calva-repl window?
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?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.
This is in my ~/.clojure/deps.edn
there are no conflicting aliases in my project deps.edn
@brandon.ringe Might be better if I file an issue on Github I guess?
There are some (closed) issues there already. Maybe you can find some help there. Just a moment.
This is the one I was thinking about: https://github.com/BetterThanTomorrow/calva/issues/1032
If info from that issue doesn't help, please file a new one.
@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?
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.)
@jlmr file an issue about this, I think. We should either document this clearly or add functionality to Calva to handle this more directly.
@pez issue added https://github.com/BetterThanTomorrow/calva/issues/1045 !
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.
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
New version of Calva just released, with this content: • Fix https://github.com/BetterThanTomorrow/calva/issues/814 • https://github.com/BetterThanTomorrow/calva/issues/1003 • https://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.)
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.
I couldn't find documentation about "calva.jackInEnv": { } settings
actually I am looking a way to make this default
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…
:thumbsup:
Default how?
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
.
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
ctrl+alt+c ctrl+alt+c is nice but how about next questions lets say can I just make "app" default or "shadow-cljs"
I think it would be amazing If I can create project settings "default repl method" and connect to repl with one shortcut
That’s what the custom connect sequences are for: https://calva.io/connect-sequences/
And about that Getting Started REPL, here’s the PR to follow for that: https://github.com/BetterThanTomorrow/calva/pull/1041
Maybe the file got corrupted in your download @m373h4n. I just tried it (on Mac, but anyway) and vscode happily just uses it.
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 🙂
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.
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