作者:Martha829 | 来源:互联网 | 2023-05-20 12:29
当我启动当前项目lein ring server
并尝试通过苹果酒从Emacs连接到它时,我收到以下警告:
; CIDER 0.8.2 (Java 1.7.0_51, Clojure 1.6.0, nREPL 0.2.6)
WARNING: The following required nREPL ops are not supported:
apropos classpath complete eldoc info inspect-start inspect-refresh inspect-pop inspect-push inspect-reset macroexpand ns-list ns-vars resource stacktrace toggle-trace-var toggle-trace-ns undef
Please, install (or update) cider-nrepl 0.8.2 and restart CIDER
user>
不过,我有一个依赖于[cider/cider-nrepl "0.8.2"]
我project.clj
.当我跑步时,这工作正常,lein repl
然后我可以从苹果酒中连接好:
; CIDER 0.8.2 (Java 1.7.0_51, Clojure 1.6.0, nREPL 0.2.6)
swedishchef.handler>
我可以看到我从leiningen wrt得到了两个不同的消息.nREPL,取决于我如何开始:
[sugarcube->swedishchef]lein ring server
See https://github.com/technomancy/leiningen/wiki/Repeatability)
Started nREPL server on port 44231
这是工作cider-nrepl连接的输出:
[sugarcube->swedishchef]lein repl
See https://github.com/technomancy/leiningen/wiki/Repeatability)
nREPL server started on port 38024 on host 127.0.0.1 - nrepl://127.0.0.1:38024
REPL-y 0.3.5, nREPL 0.2.6
看着输出lein deps :tree
我没有看到任何问题.所以,我的第一个问题是这是否应该起作用,即是否cider-nrepl
应该覆盖lein ring
s行为.nrepl启动?如果是这样,有人可以提供一些进一步排除故障的建议吗?
1> mavbozo..:
使用最新的lein-ring
插件版本0.9.2并在project.clj中添加:nrepl-middleware
包含nrepl-middlewares的向量:repl-options
例如,我通过创建项目lein new compojure-app my-app
.然后,我通过在~/.lein/profiles.clj
ex中创建一个空的leiningen配置文件来测试它.{:yolo {}}
并启动响铃服务器lein with-profile yolo,dev ring server
.
(defproject my-app "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.6.0"]
[compojure "1.1.6"]
[hiccup "1.0.5"]
[ring-server "0.3.1"]
[cider/cider-nrepl "0.8.2"]]
:plugins [[lein-ring "0.9.2"]]
:ring {:handler my-app.handler/app
:init my-app.handler/init
:destroy my-app.handler/destroy
:nrepl {:start? true}}
:repl-options {:nrepl-middleware
[cider.nrepl.middleware.apropos/wrap-apropos
cider.nrepl.middleware.classpath/wrap-classpath
cider.nrepl.middleware.complete/wrap-complete
cider.nrepl.middleware.info/wrap-info
cider.nrepl.middleware.inspect/wrap-inspect
cider.nrepl.middleware.macroexpand/wrap-macroexpand
cider.nrepl.middleware.ns/wrap-ns
cider.nrepl.middleware.resource/wrap-resource
cider.nrepl.middleware.stacktrace/wrap-stacktrace
cider.nrepl.middleware.test/wrap-test
cider.nrepl.middleware.trace/wrap-trace
cider.nrepl.middleware.undef/wrap-undef]}
:profiles
{:uberjar {:aot :all}
:production
{:ring
{:open-browser? false, :stacktraces? false, :auto-reload? false}}
:dev
{:dependencies [[ring-mock "0.1.5"] [ring/ring-devel "1.3.1"]]}})