Skip to content

Commit f7f40ac

Browse files
committed
Recognize let-go as a known nREPL runtime
let-go (https://github.com/nooga/let-go) is a Clojure dialect implemented in Go that ships an nREPL server. Connections work today via plain `cider-connect-clj`, but `cider-runtime` reported `generic` for them, so the connection info line was bare (no runtime version). Add a `cider--let-go-version` helper that reads the `let-go` key from the `describe` response's `versions` map (let-go reports separate `major`/`minor` fields rather than a `version-string`, hence the custom format). Wire it into `cider-runtime`, the capability table in `cider--connected-handler`, and the `cider--connection-info` runtime cond. Also list let-go on the "Other Platforms" docs page. Verified end-to-end against a running let-go 2.0.2 nREPL: connection info reads `CLJ project@localhost:2137 (let-go 1.0)` and a simple `(+ 1 2)` round-trips as expected.
1 parent 6d48422 commit f7f40ac

4 files changed

Lines changed: 22 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- 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.
1111
- 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.
1212
- 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)).
13+
- 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)`.
1314
- 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.
1415

1516
### Bugs fixed

doc/modules/ROOT/pages/platforms/other_platforms.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Here's an incomplete list of Clojure platforms that you can use as described abo
2929
* https://github.com/babashka/nbb[nbb]
3030
* https://github.com/babashka/scittle[scittle]
3131
* https://github.com/BetterThanTomorrow/joyride[joyride]
32+
* https://github.com/nooga/let-go[let-go] (a Clojure dialect implemented in Go)
3233

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

lisp/cider-connection.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ See `cider-connection-capabilities'."
254254
('babashka '(babashka jvm-compilation-errors))
255255
('nbb '(cljs))
256256
('scittle '(cljs))
257+
('let-go '(let-go))
257258
(_ '()))
258259
(when
259260
(eq cider-repl-type 'cljs)
@@ -347,6 +348,13 @@ about this buffer (like variable `cider-repl-type')."
347348
(plist-get nrepl-endpoint :port)
348349
(cider--babashka-version)
349350
(cider--babashka-nrepl-version)))
351+
((cider--let-go-version)
352+
(format "%s%s@%s:%s (let-go %s)"
353+
(if genericp "" (upcase (concat (symbol-name cider-repl-type) " ")))
354+
(or (cider--project-name nrepl-project-dir) "<no project>")
355+
(plist-get nrepl-endpoint :host)
356+
(plist-get nrepl-endpoint :port)
357+
(cider--let-go-version)))
350358
(t
351359
(format "%s%s@%s:%s"
352360
(if genericp "" (upcase (concat (symbol-name cider-repl-type) " ")))

lisp/cider-session.el

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,25 @@ But helps us know if this is a nbb repl, or not."
203203
(when nrepl-versions
204204
(nrepl-dict-get nrepl-versions "scittle-nrepl"))))
205205

206+
(defun cider--let-go-version ()
207+
"Retrieve the underlying connection's let-go version.
208+
Formatted as \"MAJOR.MINOR\" since let-go's nREPL `describe` response
209+
splits the version into separate fields rather than a `version-string`."
210+
(with-current-buffer (cider-current-repl)
211+
(when-let* ((versions nrepl-versions)
212+
(lg (nrepl-dict-get versions "let-go")))
213+
(format "%s.%s"
214+
(or (nrepl-dict-get lg "major") "?")
215+
(or (nrepl-dict-get lg "minor") "?")))))
216+
206217
(defun cider-runtime ()
207218
"Return the runtime of the nREPl server."
208219
(cond
209220
((cider--clojure-version) 'clojure)
210221
((cider--babashka-version) 'babashka)
211222
((cider--nbb-nrepl-version) 'nbb)
212223
((cider--scittle-nrepl-version) 'scittle)
224+
((cider--let-go-version) 'let-go)
213225
(t 'generic)))
214226

215227
(defun cider-runtime-clojure-p ()

0 commit comments

Comments
 (0)