vlaaad / reveal

Read Eval Visualize Loop for Clojure

Home Page:https://vlaaad.github.io/reveal/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cursive setup with leiningen

opened this issue · comments

How do I setup reveal with cursive and leiningen? I've created a profile with reveal as dep and an init-ns that calls reveal/repl. Doing this results in a read only repl.

I assume you use nrepl instead of repls?

@vlaaad Yes. I added an nrepl edn as well.

This setup worked for me (without .nrepl.edn):

(defproject com.example/reveal "1.0.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.10.1"]]
  :profiles {:reveal {:dependencies [[vlaaad/reveal "1.2.186"]]
                      :repl-options {:nrepl-middleware [vlaaad.reveal.nrepl/middleware]}}})

Does it work for you?

I'm getting this error:

Starting nREPL server...
/nix/store/i1cipbynh6c1n7ripmch0r82xfcx98my-jetbrains-jdk-11.0.7-b64/lib/openjdk/bin/java -Dfile.encoding=UTF-8 -Dclojure.compile.path=/home/fctorial/src/pgs/bin_clj/target/classes -Dapp.version=0.1.0-SNAPSHOT -Dclojure.debug=false -Didea.launcher.port=34587 -Didea.launcher.bin.path=/home/fctorial/software/idea-IU/bin -classpath /home/fctorial/src/pgs/bin_clj/test:/home/fctorial/src/pgs/bin_clj/src:/home/fctorial/src/pgs/bin_clj/resources:/home/fctorial/src/pgs/bin_clj/target/classes:/home/fctorial/.m2/repository/org/nibor/autolink/autolink/0.6.0/autolink-0.6.0.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util-format/0.62.0/flexmark-util-format-0.62.0.jar:/home/fctorial/.m2/repository/org/openjfx/javafx-media/15.0.1/javafx-media-15.0.1.jar:/home/fctorial/.m2/repository/org/clojure/tools.reader/1.3.2/tools.reader-1.3.2.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util-sequence/0.62.0/flexmark-util-sequence-0.62.0.jar:/home/fctorial/.m2/repository/io/netty/netty-common/4.1.30.Final/netty-common-4.1.30.Final.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util-data/0.62.0/flexmark-util-data-0.62.0.jar:/home/fctorial/.m2/repository/org/openjfx/javafx-controls/15.0.1/javafx-controls-15.0.1-linux.jar:/home/fctorial/.m2/repository/org/clojure/data.priority-map/1.0.0/data.priority-map-1.0.0.jar:/home/fctorial/.m2/repository/org/apache/commons/commons-lang3/3.10/commons-lang3-3.10.jar:/home/fctorial/.m2/repository/cljfx/cljfx/1.7.12/cljfx-1.7.12-jdk11.jar:/home/fctorial/.m2/repository/org/clojure/tools.analyzer.jvm/1.1.0/tools.analyzer.jvm-1.1.0.jar:/home/fctorial/.m2/repository/org/openjfx/javafx-web/15.0.1/javafx-web-15.0.1.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-ext-autolink/0.62.0/flexmark-ext-autolink-0.62.0.jar:/home/fctorial/.m2/repository/org/openjfx/javafx-graphics/15.0.1/javafx-graphics-15.0.1.jar:/home/fctorial/.m2/repository/org/ow2/asm/asm/5.2/asm-5.2.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util-collection/0.62.0/flexmark-util-collection-0.62.0.jar:/home/fctorial/.m2/repository/org/clojure/tools.analyzer/1.0.0/tools.analyzer-1.0.0.jar:/home/fctorial/.m2/repository/cljfx/css/1.1.0/css-1.1.0.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-ext-wikilink/0.62.0/flexmark-ext-wikilink-0.62.0.jar:/home/fctorial/.m2/repository/org/clojure/core.cache/1.0.207/core.cache-1.0.207.jar:/home/fctorial/.m2/repository/clj-tuple/clj-tuple/0.2.2/clj-tuple-0.2.2.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util-options/0.62.0/flexmark-util-options-0.62.0.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util-ast/0.62.0/flexmark-util-ast-0.62.0.jar:/home/fctorial/.m2/repository/org/clojure/core.memoize/1.0.236/core.memoize-1.0.236.jar:/home/fctorial/.m2/repository/org/openjfx/javafx-web/15.0.1/javafx-web-15.0.1-linux.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util-visitor/0.62.0/flexmark-util-visitor-0.62.0.jar:/home/fctorial/.m2/repository/potemkin/potemkin/0.4.5/potemkin-0.4.5.jar:/home/fctorial/.m2/repository/org/jetbrains/annotations/15.0/annotations-15.0.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util-html/0.62.0/flexmark-util-html-0.62.0.jar:/home/fctorial/.m2/repository/io/netty/netty-buffer/4.1.30.Final/netty-buffer-4.1.30.Final.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util-misc/0.62.0/flexmark-util-misc-0.62.0.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util/0.62.0/flexmark-util-0.62.0.jar:/home/fctorial/.m2/repository/org/openjfx/javafx-base/15.0.1/javafx-base-15.0.1-linux.jar:/home/fctorial/.m2/repository/cljfx/cljfx/1.7.12/cljfx-1.7.12.jar:/home/fctorial/.m2/repository/org/clojure/clojure/1.10.1/clojure-1.10.1.jar:/home/fctorial/.m2/repository/riddley/riddley/0.1.12/riddley-0.1.12.jar:/home/fctorial/.m2/repository/org/openjfx/javafx-media/15.0.1/javafx-media-15.0.1-linux.jar:/home/fctorial/.m2/repository/org/openjfx/javafx-graphics/15.0.1/javafx-graphics-15.0.1-linux.jar:/home/fctorial/.m2/repository/org/clojure/core.async/1.3.610/core.async-1.3.610.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark/0.62.0/flexmark-0.62.0.jar:/home/fctorial/.m2/repository/org/clojure/core.specs.alpha/0.2.44/core.specs.alpha-0.2.44.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util-dependency/0.62.0/flexmark-util-dependency-0.62.0.jar:/home/fctorial/.m2/repository/org/openjfx/javafx-controls/15.0.1/javafx-controls-15.0.1.jar:/home/fctorial/.m2/repository/vlaaad/reveal/1.2.186/reveal-1.2.186.jar:/home/fctorial/.m2/repository/org/openjfx/javafx-base/15.0.1/javafx-base-15.0.1.jar:/home/fctorial/.m2/repository/org/clojure/spec.alpha/0.2.176/spec.alpha-0.2.176.jar:/home/fctorial/.m2/repository/com/vladsch/flexmark/flexmark-util-builder/0.62.0/flexmark-util-builder-0.62.0.jar:/home/fctorial/.m2/repository/fctorial/parse_struct/0.8.0/parse_struct-0.8.0.jar:/home/fctorial/software/idea-IU-203.5981.155/lib/idea_rt.jar com.intellij.rt.execution.application.AppMainV2 clojure.main -i /tmp/form-init6070756686801096465.clj
No nREPL ack received
Error loading nrepl.server: Could not locate nrepl/server__init.class, nrepl/server.clj or nrepl/server.cljc on classpath.
Error loading complete.core: Could not locate complete/core__init.class, complete/core.clj or complete/core.cljc on classpath.
Error loading vlaaad.reveal.nrepl: Syntax error compiling at (vlaaad/reveal/nrepl.clj:1:1).
Syntax error (ClassNotFoundException) compiling at (/tmp/form-init6070756686801096465.clj:1:1693).
nrepl.server

Full report at:
/tmp/clojure-2904235629007549487.edn

Process finished with exit code 1
No nREPL ack received
No nREPL ack received

Full error report:

https://gist.github.com/fctorial/9d48c9199e79d018ff28ecbc08dbf89c

Hmm, it looks like there is no nrepl on the classpath, perhaps another dependency you need to add? I tried that project.clj with calva/vscode that adds nrepl dependency automatically. The exact command was this:

lein \
update-in :dependencies conj '[nrepl,"0.8.3"]' -- \
update-in :dependencies conj '[clj-kondo,"2020.04.05"]' -- \
update-in :plugins conj '[cider/cider-nrepl,"0.25.6"]' -- \
update-in '[:repl-options,:nrepl-middleware]' conj '["cider.nrepl/cider-middleware"]' -- \
with-profile +reveal repl :headless

Reveal has a runtime dependency on nrepl, meaning you have to specify nrepl dependency yourself.

This works.