1

I was using Vscode + Calva for developing Clojure. And I watch this and try to use Reveal with Calva.

I see this and add cider.nrepl/cider-middleware to middleware.

(I'm using this deps.edn and just add cider/cider-nrepl {:mvn/version "0.26.0"} and cider.nrepl/cider-middleware. doc mentioned only cider.nrepl/cider-middleware, but in my environment, without cider/cider-nrepl {:mvn/version "0.26.0"} makes error. it saids no cider in classpath)

Here's my deps.edn.

:repl/reveal-light-nrepl
  {:extra-deps {vlaaad/reveal     {:mvn/version "1.3.212"}
                nrepl/nrepl       {:mvn/version "0.8.3"}
                cider/cider-nrepl {:mvn/version "0.26.0"}}
   :jvm-opts   ["-Dvlaaad.reveal.prefs={:theme,:light,:font-family,\"https://ff.static.1001fonts.net/u/b/ubuntu.mono.ttf\",:font-size,32}"]
   :main-opts  ["-m" "nrepl.cmdline"
                "--middleware" "[vlaaad.reveal.nrepl/middleware, cider.nrepl/cider-middleware]"]}

When I run clojure -M:repl/reveal-light-nrepl, Reveal works fine.

Now I want to use it with my project with Calva.

I mean, clojure -M:repl/reveal-light-nrepl is just standalone. not project integrated.

What should I do?

I think line in this might help.

And then jack-in choosing the deps.edn option and then pick the :reveal-nrepl-middleware alias.

But I don't know what it means. (I'm a Clojure newbie.) I know how to jack-in. But what I see is just choosing build option. I don't see reveal-nrepl-middleware.

Maybe I should look at Custom REPL Connect Sequences?

yujonglee
  • 55
  • 1
  • 6

1 Answers1

0

Following the link that you provided, I would try this:

Dependencies only

If you don't want to use the nrepl-middleware you can configure just the dependency and then start Reveal yours

The alias:

:reveal-dep-only {:extra-deps {vlaaad/reveal {:mvn/version "1.3.194"}}}

A custom REPL command for starting Reveal in your project:

    "calva.customREPLCommandSnippets": [
    ...
    {
        "name": "Start Reveal Tapper",
        "snippet": "(require '[vlaaad.reveal :as reveal])(add-tap (reveal/ui))",
        "key": "sr"
    },
    ...
]

See Custom REPL Command for how to configure more commands, and bind shortcuts to them, to make Reveal integration nice for you.

Messing with the middleware options can be a bit tricky for a beginner, so I would try to steer clear from that. If you just add the deps then you can include :reveal-dep-only from the alias drop down when you jack-in via Calva. Then, once in the REPL window, fire off the custom command snippet using the "key" that you defined in your settings.json

Another option that I would like to point out is Portal. Portal is browser based, and works by registering a tap>, which is my preferred way to debug these days.

There's even a Portal extension for vscode which handles all the integration for you! https://marketplace.visualstudio.com/items?itemName=djblue.portal

Justin Frost
  • 46
  • 1
  • 2