一些人( @magnars @dpsutton jumar?)昨天在 Clojurians 上讨论了我注意到的一个问题。 我没有所有的细节,但我从他们的描述中借用了,但会尽力帮助报告。
文档说“要根据当前 Clojure 缓冲区中的 Clojure 命名空间切换到相关的 REPL 缓冲区,请使用: C-c C-z
。” 从cljs-mode,它应该切换到项目的cljs-repl; 从 clojure-mode 它应该切换到项目的 clj-repl。
相反,它切换到最新的 REPL。
@dpsutton说它与以下内容有关: https :
要重现问题:
莱宁根 2.7.1
Emacs:25.2.1
Arch/Antergos Linux
我的想法是 repl 分辨率是问题所在。 在cider-current-connection
,当有多个连接时,它只会依赖最近的连接,这对我来说似乎是错误的。 这听起来像是一个应该进一步向下的解决策略。 我在 clj repl 中加载了 cljs 缓冲区的实例,在其他项目 repl 中加载了 clj 文件。
(cond
((not connections) nil)
;; if you're in a REPL buffer, it's the connection buffer
((and (derived-mode-p 'cider-repl-mode) (right-type-p (current-buffer) type)))
((eq cider-request-dispatch 'static) (car connections))
((= 1 (length connections)) (right-type-p (car connections) type))
(t (let ((project-connections (cider-find-connection-buffer-for-project-directory
nil :all-connections))
(guessed-type (or type (cider-connection-type-for-buffer))))
(or
;; cljc
(and (equal guessed-type "multi")
(most-recent-buf project-connections nil))
;; clj or cljs
(and guessed-type
(or (most-recent-buf project-connections guessed-type)
(most-recent-buf connections guessed-type)))
;; when type was not specified or guessed
(most-recent-buf project-connections type)
(most-recent-buf connections type)))))
问题直接在于cider-switch-to-repl-buffer
。 顺便说一句,同样的问题显示cider-switch-to-last-clojure-buffer
。 会看看。
这是至少解决 CLJS 案例的 PR #2085。
对我来说,在 CLJC 文件中切换时不清楚。
最有用的评论
这是至少解决 CLJS 案例的 PR #2085。
对我来说,在 CLJC 文件中切换时不清楚。