-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow connecting to nbb via connect-clj (#3061) #3272
Changes from all commits
ed8ee40
f0dc573
65b9ce1
d66c831
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -303,6 +303,7 @@ focused." | |
(let* ((font-value (if cider-result-use-clojure-font-lock | ||
(cider-font-lock-as-clojure value) | ||
value)) | ||
(font-value (string-trim-right font-value)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't quite understand the purpose of this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nbb errors always had a trailing newline and the I think the visual of the overlays is better without the newline. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. This name |
||
(used-overlay (when (and point cider-use-overlays) | ||
(cider--make-result-overlay font-value | ||
:where point | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -153,7 +153,8 @@ you'd like to use the default Emacs behavior use | |
(make-obsolete-variable 'cider-repl-print-level 'cider-print-options "0.21") | ||
|
||
(defvar cider-repl-require-repl-utils-code | ||
'((clj . "(clojure.core/apply clojure.core/require clojure.main/repl-requires)") | ||
'((clj . "(when-let [requires (resolve 'clojure.main/repl-requires)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You'll have to explain me the need for this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you currently connect to joyride it throws "cannot resolve symbol repl-requires". It was the same for an earlier version of nbb I basiclly want to make the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should also document somewhere that such REPL automatic util requires are limited to Clojure and the hosted ClojureScript. |
||
(clojure.core/apply clojure.core/require @requires))") | ||
(cljs . "(require '[cljs.repl :refer [apropos dir doc find-doc print-doc pst source]])"))) | ||
|
||
(defcustom cider-repl-init-code (list (cdr (assoc 'clj cider-repl-require-repl-utils-code))) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -778,9 +778,13 @@ Generally you should not disable this unless you run into some faulty check." | |
:safe #'booleanp | ||
:package-version '(cider . "0.17.0")) | ||
|
||
(defun cider-clojurescript-present-p () | ||
"Return non nil when ClojureScript is present." | ||
(nrepl-dict-get (cider-sync-tooling-eval "cljs.core/demunge") "value")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's the advantage of this over the previous check? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #3255 Basically |
||
|
||
(defun cider-verify-clojurescript-is-present () | ||
"Check whether ClojureScript is present." | ||
(unless (cider-library-present-p "cljs.core") | ||
(unless (cider-clojurescript-present-p) | ||
(user-error "ClojureScript is not available. See https://docs.cider.mx/cider/basics/clojurescript for details"))) | ||
|
||
(defun cider-verify-piggieback-is-present () | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
= Scittle, Nbb, Joyride, and future plain repls | ||
|
||
The default cider (clj-repl) should be capable of connecting to any | ||
nrepl server that provides minimal functionality. | ||
|
||
As such, all of these work: | ||
https://github.com/babashka/nbb[nbb], | ||
https://github.com/babashka/scittle[scittle], https://github.com/BetterThanTomorrow/joyride[joyride] | ||
|
||
First start an nrepl server (the project's Readme usually has a section | ||
on starting a nrepl server). | ||
|
||
You can use | ||
|
||
kbd:[M-x `cider-connect-clj` <RET>] | ||
|
||
to connect to any plain Clojure(Script) nrepl server. | ||
|
||
Features: | ||
|
||
* Eval, load file etc. | ||
* Errors as overlays. (The default cider error buffer is not implemented currently). | ||
* Other nrepl features the server provides; This might be rather minimal. | ||
|
||
Nbb, Scittle and Joyride all have quite cool completions already. | ||
|
||
== Note | ||
|
||
For nbb you can alternatively connect via cljs, see xref:platform/nbb.adoc[Nbb] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to me this change won't result in anything different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, actually the similar names confused me. Now I see the last branch is different.