Function: cider--connection-info

cider--connection-info is a byte-compiled function defined in cider-connection.el.

Signature

(cider--connection-info CONNECTION-BUFFER &optional GENERICP)

Documentation

Return info about CONNECTION-BUFFER.

Info contains project name, current REPL namespace, host:port endpoint and runtime details. When GENERICP is non-nil, don't provide specific info about this buffer (like variable cider-repl-type(var)/cider-repl-type(fun)).

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-connection.el
;;; Connection Info

(defun cider--connection-info (connection-buffer &optional genericp)
  "Return info about CONNECTION-BUFFER.
Info contains project name, current REPL namespace, host:port endpoint and
runtime details.  When GENERICP is non-nil, don't provide specific info
about this buffer (like variable `cider-repl-type')."
  (with-current-buffer connection-buffer
    ;; The project/host/port endpoint is the same regardless of runtime; only
    ;; the trailing version detail differs.  Build the common part once and
    ;; append the runtime-specific suffix.
    (let* ((endpoint (format "%s%s@%s:%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)))
           (runtime (cond
                     ((cider--clojure-version)
                      (format " (Java %s, Clojure %s, nREPL %s)"
                              (cider--java-version)
                              (cider--clojure-version)
                              (cider--nrepl-version)))
                     ((cider--babashka-version)
                      (format " (Babashka %s, babashka.nrepl %s)"
                              (cider--babashka-version)
                              (cider--babashka-nrepl-version)))
                     ((cider--let-go-version)
                      (format " (let-go %s)" (cider--let-go-version)))
                     (t "")))
           (info (concat endpoint runtime)))
      (if cider-default-session
          (format "%s [default session: %s]" info cider-default-session)
        info))))