This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-22
Channels
- # announcements (11)
- # babashka (4)
- # beginners (98)
- # calva (18)
- # chlorine-clover (1)
- # cider (44)
- # clj-kondo (6)
- # clojure (61)
- # clojure-australia (4)
- # clojure-dev (4)
- # clojure-europe (132)
- # clojure-italy (5)
- # clojure-nl (4)
- # clojure-uk (31)
- # clojurescript (40)
- # community-development (8)
- # conjure (20)
- # data-science (1)
- # datomic (42)
- # defnpodcast (6)
- # emacs (3)
- # events (1)
- # fulcro (9)
- # graphql (2)
- # hugsql (1)
- # jobs (1)
- # malli (4)
- # off-topic (28)
- # pathom (27)
- # rdf (1)
- # re-frame (10)
- # reagent (4)
- # remote-jobs (1)
- # reveal (32)
- # sci (5)
- # shadow-cljs (18)
- # spacemacs (1)
- # tools-deps (62)
- # xtdb (4)
Hi, is anyone able to use Reveal with Calva? I was able to fire up an nrepl session with:
clj -A:reveal -m nrepl.cmdline --middleware '[vlaaad.reveal.nrepl/middleware]'
The Reveal shows up, then I’m able to connect to the nrepl session from Calva, but once I start evaluating code from Calva, I don’t see any output in the Reveal window except this:
*ns*
=> user
Worked fine, I did what you did: started nrepl in terminal and connected to it with Calva
I’m probably doing something wrong. When I eval e.g.: {:a 1}
I can see the eval output coming out in the Calva repl output, but nothing comes out in the Reveal window.
Quick summary of the steps I took:
1. run clj -A:reveal -m nrepl.cmdline --middleware '[vlaaad.reveal.nrepl/middleware]'
in the terminal
2. Check out the reveal window, it’s empty
3. Go to Calva and type ctrl+c ctrl+c
4. Select Clojure CLI
as project type
5. Select the nrepl port
6. As soon as Calva connects, I see => user
namespace appear in the output
7. Place the cursor on some form and type ctrl+enter
8. The eval result appears in Calva’s repl output, but nothing appears in the reveal window.
I started with this:
$ clj -Sdeps "{:deps {nrepl/nrepl {:mvn/version """"0.6.0""""} vlaaad/reveal {:mvn/version """"1.0.130""""}}}" -M -m nrepl.cmdline --middleware "[vlaaad.reveal.nrepl/middleware]"
(multiple quotes because it's powershell)This is my reveal alias:
{:reveal {:extra-deps {vlaaad/reveal {:mvn/version "1.0.130"}
nrepl/nrepl {:mvn/version "0.8.2"}}}}
I don't know about shortcuts, but I used "calva: connect..." action where I needed to specify the port
ok I see something different in the reveal window:
(try
(clojure.lang.Compiler/load
(java.io.StringReader.
((clojure.core/deref
(clojure.core/deref
(var nrepl.middleware.load-file/file-contents)))
(quote
["/Users/ccidral/lusa/tools/api-script/src/api_script/core.clj" G__7056])))
"/Users/ccidral/lusa/tools/api-script/src/api_script/core.clj" "core.clj")
(finally
(clojure.core/swap!
(clojure.core/deref (var nrepl.middleware.load-file/file-contents))
clojure.core/dissoc
(quote ["/Users/ccidral/lusa/tools/api-script/src/api_script/core.clj" G__7056]))))
=> nil
I remember seeing this before, the first time I ran reveal with nrepl 0.8.2, and then I didn’t see it anymore. Now that I changed nrepl version to 0.6.0 this output appeared again.
I right-clicked on that output and selected view:value
. It shows a huge map, looks like some nrepl internal state. There’s an error in there:
"Could not locate clj_kondo/core__init.class, clj_kondo/core.clj or clj_kondo/core.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name."
this kind of stuff is unavoidable with nrepl because there is no good way to tell in the nrepl if sent command is user-triggered evaluation or some tool is doing that
some more context:
#'clojure.core/*e #reveal/error{:via [{
:type java.io.FileNotFoundException
:message "Could not locate clj_kondo/core__init.class, clj_kondo/core.clj or clj_kondo/core.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name."
:at [clojure.lang.RT load "RT.java" 462]}]
Added clj-kondo dep, I don’t see that output anymore, but I’m getting the same behavior as before.