将Cider连接到Luminus +CLJS Figwheel repl

4

在过去,我对Cider REPL的使用非常简单; 在一个项目的clj文件中,我使用cider-jack-in就可以开始工作了(假设我在.lein/profiles.clj中有以下设置)。

;; ~/.lein/profiles.clj
{:user {:plugins [[lein-localrepo "0.5.2"]
          [cider/cider-nrepl "0.10.0-SNAPSHOT"]]
    :dependencies [[org.clojure/tools.nrepl "0.2.7"]]
    }}

现在我直接操作如下:
<user> Clojure/ 17:44$ lein new luminus wants-cider +cljs
Generating a Luminus project.
<user> Clojure/ 17:45$ cd wants-cider/
<user> wants-cider/ 17:45$ lein run
15-Sep-17 17:45:59 user-linuxbox INFO [wants-cider.core] - nREPL server started on port 7000
15-Sep-17 17:45:59 user-linuxbox INFO [wants-cider.handler] - 
-=[wants-cider started successfully using the development profile]=-
17:45:59.789 INFO  [org.projectodd.wunderboss.web.Web] (main) Registered web context /
15-Sep-17 17:45:59 user-linuxbox INFO [wants-cider.core] - server started on port: 3000

# new shell
<user> wants-cider/ 17:50$ lein figwheel
Figwheel: Starting server at http://localhost:3449
Focusing on build ids: app
Compiling "resources/public/js/app.js" from ["src-cljs" "env/dev/cljs"]...
Successfully compiled "resources/public/js/app.js" in 5.757 seconds.
Started Figwheel autobuilder
WARNING: unable to load "cemerick.piggieback/wrap-cljs-repl" middleware

Launching ClojureScript REPL for build: app

# ... insructions ...

Prompt will show when figwheel connects to your application
To quit, type: :cljs/quit
cljs.user=> 

从这里开始,我该如何连接我的 Cider REPL?

1个回答

4

你必须在project.clj文件的:profiles :dev部分指定figwheel nrepl选项:

 :profiles {:dev {
                   ;; ....
                   :figwheel {:nrepl-port 7888 }

然后从CIDER连接到nREPL:

C-c M-c <or> M-x cider-connect
;; enter figwheel host, port, in this case -- localhost, 7888
;; then, in appeared REPL buffer:
user> (use 'figwheel-sidecar.repl-api)
user> (cljs-repl)
cljs.user=> 

info: https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接