gpt4 book ai didi

clojure - 在 CIDER 中设置 Figwheel REPL 时遇到问题

转载 作者:行者123 更新时间:2023-12-02 13:20:24 24 4
gpt4 key购买 nike

我刚刚开始尝试使用以下模板制作一个简单的 cljs 应用程序:

lein new Figwheel someproject -- --reagent

我希望在 cider 中使用 REPL 进行 cljs 开发,就像我通常在普通 clj 项目中使用的那样,所以我做了一些研究并最终在这里:

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

我通读了说明,并验证了所有正确的依赖项都在 project.clj 中(不必更改任何内容,看起来模板添加了我需要的所有内容)。上述链接中的最后一步表明我需要将以下代码添加到我的 emacs 配置中:

(require 'cider)
(setq cider-cljs-lein-repl
"(do (require 'figwheel-sidecar.repl-api)
(figwheel-sidecar.repl-api/start-figwheel!)
(figwheel-sidecar.repl-api/cljs-repl))")

现在 - 我是一名 emacs 新手,所以我使用的设置仍然是我第一次从“Clojure for the Brave and True”中学到的设置:

https://github.com/flyingmachine/emacs-for-clojure

我尝试首先将上述代码段放入 ~/.emacs.d/init.el 中,但每当我尝试 M-x cider-jack-in ... ,没有 cider-jack-in-clojurescript 选项。我还尝试将代码片段放入 ~/.emacs.d/customizations/setup-clojure.el 中,这似乎是一个更合乎逻辑的主页,但结果相同。

我真的很希望能够启动并运行这个 REPL,因此我们将不胜感激。

最佳答案

我通常使用普通的cider-jack-in,然后从 REPL 调用所有内容:

(use 'figwheel-sidecar.repl-api)
(start-figwheel!)
(cljs-repl)

如果您想要两个 repl,您可以在通过 cider-connect 打开的单独 REPL 中执行最后一步 (cljs-repl)

如果您刚刚开始使用 Emacs,我相信您最好的选择是 Spacemacs:http://spacemacs.org/ 。如果你有兴趣,我做了一个blog post和一个video关于我的开发工作流程。

关于clojure - 在 CIDER 中设置 Figwheel REPL 时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46161756/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com