Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Cache the result of `cider--running-nrepl-paths` (used by `cider-locate-running-nrepl-ports`) for `cider-running-nrepl-paths-cache-ttl` seconds (default 5). Repeated `cider-connect` completions no longer re-spawn a fresh round of `ps`/`lsof` subprocesses each time. `cider-clear-running-nrepl-paths-cache` discards the cache on demand.
- New `nrepl-make-eval-handler` with a keyword-arg API (`:on-value`, `:on-stdout`, `:on-stderr`, `:on-done`, `:on-eval-error`, `:on-content-type`, `:on-truncated`). Sub-handlers no longer take a buffer argument -- they close over whatever they need. `nrepl-make-response-handler`, the legacy 7-positional-arg form, is preserved as an obsolete shim that adapts the old (buffer x) lambdas to the new (x) lambdas, so existing extensions keep working.
- New `cider-repl-history-doctor` command: walks `cider-repl-input-history` looking for entries whose parens don't balance under Clojure syntax, shows each in a side buffer, and asks whether to delete it. When done, rewrites `cider-repl-history-file` if one is configured. Useful for cleaning up history after a typo got committed that breaks `cider-repl-history` rendering (see [#3915](https://github.com/clojure-emacs/cider/issues/3915)).
- Recognize [let-go](https://github.com/nooga/let-go) (a Clojure dialect implemented in Go) as a known nREPL runtime. `cider-runtime` returns `let-go` for these connections and the connection info line shows the runtime version, e.g. `CLJ project@localhost:2137 (let-go 1.0)`.
- Decouple the nREPL transport layer from CIDER's UI layer (closes [#1099](https://github.com/clojure-emacs/cider/issues/1099)). `nrepl-make-eval-handler` is now CIDER-agnostic: it no longer references `nrepl-namespace-handler-function`, `nrepl-err-handler-function`, `nrepl-need-input-handler-function`, or any hardcoded UI strings. New `:on-ns` and `:on-status` keyword slots let any consumer wire up their own namespace tracking and status handling. The editor-level `cider-make-eval-handler` wraps it with CIDER's UI behavior (ns tracking, default error handler, need-input prompt, "Evaluation interrupted." / "Namespace not found." messages); in-tree callers all use it.

### Bugs fixed
Expand Down
1 change: 1 addition & 0 deletions doc/modules/ROOT/pages/platforms/other_platforms.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Here's an incomplete list of Clojure platforms that you can use as described abo
* https://github.com/babashka/nbb[nbb]
* https://github.com/babashka/scittle[scittle]
* https://github.com/BetterThanTomorrow/joyride[joyride]
* https://github.com/nooga/let-go[let-go] (a Clojure dialect implemented in Go)

NOTE: For `nbb` you can alternatively connect via `cider-connect-cljs`, see xref:platforms/nbb.adoc[nbb].

Expand Down
8 changes: 8 additions & 0 deletions lisp/cider-connection.el
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ See `cider-connection-capabilities'."
('babashka '(babashka jvm-compilation-errors))
('nbb '(cljs))
('scittle '(cljs))
('let-go '(let-go))
(_ '()))
(when
(eq cider-repl-type 'cljs)
Expand Down Expand Up @@ -347,6 +348,13 @@ about this buffer (like variable `cider-repl-type')."
(plist-get nrepl-endpoint :port)
(cider--babashka-version)
(cider--babashka-nrepl-version)))
((cider--let-go-version)
(format "%s%s@%s:%s (let-go %s)"
(if genericp "" (upcase (concat (symbol-name cider-repl-type) " ")))
(or (cider--project-name nrepl-project-dir) "<no project>")
(plist-get nrepl-endpoint :host)
(plist-get nrepl-endpoint :port)
(cider--let-go-version)))
(t
(format "%s%s@%s:%s"
(if genericp "" (upcase (concat (symbol-name cider-repl-type) " ")))
Expand Down
12 changes: 12 additions & 0 deletions lisp/cider-session.el
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,25 @@ But helps us know if this is a nbb repl, or not."
(when nrepl-versions
(nrepl-dict-get nrepl-versions "scittle-nrepl"))))

(defun cider--let-go-version ()
"Retrieve the underlying connection's let-go version.
Formatted as \"MAJOR.MINOR\" since let-go's nREPL `describe` response
splits the version into separate fields rather than a `version-string`."
(with-current-buffer (cider-current-repl)
(when-let* ((versions nrepl-versions)
(lg (nrepl-dict-get versions "let-go")))
(format "%s.%s"
(or (nrepl-dict-get lg "major") "?")
(or (nrepl-dict-get lg "minor") "?")))))

(defun cider-runtime ()
"Return the runtime of the nREPl server."
(cond
((cider--clojure-version) 'clojure)
((cider--babashka-version) 'babashka)
((cider--nbb-nrepl-version) 'nbb)
((cider--scittle-nrepl-version) 'scittle)
((cider--let-go-version) 'let-go)
(t 'generic)))

(defun cider-runtime-clojure-p ()
Expand Down
Loading