Skip to content

1.22.0

Latest

Choose a tag to compare

@bbatsov bbatsov released this 16 Jun 13:45
· 5 commits to master since this release

New features

  • #3645: Show a spinner in the mode line while tests are running.
  • #3865: Add default session feature to bypass sesman's project-based dispatch (cider-set-default-session, cider-clear-default-session).
  • #3930: Inspector: add help message with keybindings.
  • #3884: Introduce cider-jack-in-tools and cider-register-jack-in-tool so third-party packages can register new project tools for cider-jack-in and cider-jack-in-universal.
  • #3888: 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.
  • #3890: New nrepl-make-eval-handler with a keyword-arg API:
    • Keyword slots: :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.
  • #3929: Keyword-argument forms for several low-level request APIs, so callers no longer pad arguments with nil to reach a later one. In every case the legacy positional function is kept as a thin shim that delegates to the new one, so existing callers (including third-party packages) keep working unchanged:
    • Eval requests: nrepl-send-eval-request (shim: nrepl-request:eval) and cider-nrepl-send-eval-request (shim: cider-nrepl-request:eval), with :ns, :line, :column, :additional-params, plus :tooling at the nREPL level and :connection at the CIDER level.
    • Sync requests: nrepl-sync-request (shim: nrepl-send-sync-request) and cider-nrepl-sync-request (shim: cider-nrepl-send-sync-request), with :abort-on-input, :tooling/:connection, and :callback.
    • Op helpers: cider-info-request (shim: cider-sync-request:info), cider-eldoc-request (shim: cider-sync-request:eldoc), cider-apropos-request (shim: cider-sync-request:apropos), and cider-load-file-request (shim: cider-request:load-file).
  • #3921: 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).
  • #3926: Recognize 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).
  • #3892: Decouple the nREPL transport layer from CIDER's UI layer (closes #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.
  • #3927: New nREPL message log commands: nrepl-show-messages pops up the messages buffer (prompting when there are multiple connections), and c in nrepl-messages-mode runs the new nrepl-clear-messages to wipe the buffer. Auto-follow on new entries now leaves windows alone if you've scrolled back to read history; only windows already at end-of-buffer get scrolled to the latest message.

New features

  • cider-eval-commands-map (C-c C-v prefix) now binds five eval commands that previously had no entry under the prefix:
    • cider-eval-last-sexp-to-repl (j/C-j)
    • cider-eval-print-last-sexp (p/C-p)
    • cider-read-and-eval (:)
    • cider-eval-defun-to-comment (;)
    • cider-pprint-eval-last-sexp-to-repl (f j e)

Bugs fixed

  • #3937: cider-find-keyword no longer opens the result in another window on a single prefix argument; only - or a double prefix does, matching the other cider-find-* commands.
  • #3938: Disabling cider-mode now removes its reader-conditional font-lock keywords instead of re-adding them, so fontification no longer lingers and repeated toggling no longer stacks duplicate keywords.
  • #3939: Fix the malformed Clojure Interaction mode menu, where "Eval and print last sexp" rendered as an empty submenu instead of a working command.
  • #3941: REPL history insertion with the mouse no longer risks inserting the wrong entry; the overlay lookup now honors the clicked position instead of point.
  • #3942: cider-log: apply the consumer's own filters when initializing a session, fix the broken cider-log-info autoload, and honor a caller-supplied logger prompt.
  • #3953: Fix the cider-debug "Forced move out of sexp" menu entry erroring with a void variable, and an off-by-one in the cider-xref no-backing-file references fallback.
  • #3933: Fix severe editor lag in Clojure buffers when no REPL is linked. Friendly-session matching no longer scans the project classpath (or the buffer's namespace) on every redisplay; it now just checks whether the buffer's file is under a session's project directory. Dependency sources jumped to via cider-find-var are pinned to their originating session instead.
  • cider-browse-spec-mode, cider-browse-spec-view-mode, and cider-browse-spec-example-mode each have an easy-menu now, exposing the drill/browse-all/generate-example commands that previously had no menu affordance.
  • cider-repl-history-mode now has an easy-menu ("REPL History") covering insert, navigation, search/filter, refresh/delete/undo, and quit.
  • cider-log-mode now has an easy-menu ("CIDER Log") covering event inspect/print, navigation, and the framework/appender/consumer/event management commands previously only reachable via the C-c M-l prefix.
  • cider-macroexpansion-mode, cider-repl-history-mode, and cider--debug-mode docstrings now include \\{...-map}, so C-h m (describe-mode) lists the active key bindings instead of just a one-line description.
  • cider-repl-mode-menu now lists cider-repl-history ("Browse REPL input history", C-c M-p) alongside the other Browse entries.
  • cider-test-menu now lists cider-test-rerun-test ("Rerun the last test", a/C-a in cider-test-commands-map) and cider-test-toggle-fail-fast (rendered as a :style toggle reflecting cider-test-fail-fast).
  • cider-browse-ns-mode-menu now lists "Operate at point" (RET) and dedicated "Filter" and "Group by" submenus that expose the h p/t/m/f/v and g t/v chords. Previously the menu showed only 3 of the 11+ bound commands.
  • cider-inspector-mode-menu now exposes the inspector's full command surface: sibling navigation, max-nested-depth, the three view toggles (pretty-print / sort-maps / only-diff, rendered as :style toggle), the object/normal view toggle, tap/print/analytics, and cider-inspect-expr-from-inspector. Previously ~13 bound commands were menu-invisible.
  • cider-mode-eval-menu now lists cider-pprint-eval-defun-at-point ("Eval top-level sexp in popup buffer", C-c C-f), cider-read-and-eval (C-c M-:), cider-undef (C-c C-u), and cider-undef-all (C-c C-M-u). All were bound but menu-invisible.
  • cider-sesman-browser-map no longer binds C-c C-i to cider-describe-connection. C-i is TAB on terminals, so the binding shadowed TAB while point was on a REPL entry in the sesman browser. C-c C-d and C-c M-d still invoke the command, alongside the j d / j i chords.
  • Fix cider-macroexpansion-mode menu's "Go to Javadoc" entry calling cider-docview-javadoc (the doc-buffer-only helper) instead of the general cider-javadoc command bound to j in the same map.
  • Fix two "ClojureScript" submenu entries in cider-mode-menu that pointed at long-renamed commands: "Connect to a ClojureScript REPL" called cider-connect-clojurescript (gone, now cider-connect-cljs) and "Create a ClojureScript REPL from a Clojure REPL" called cider-jack-in-sibling-clojurescript (never existed; the right command is cider-connect-sibling-cljs).
  • Fix Xref menu entries "Find fn dependencies" / "Find fn dependencies and select" in cider-mode-menu that called the non-existent cider-xref-fn-defs / cider-xref-fn-defs-select. They now correctly call cider-xref-fn-deps / cider-xref-fn-deps-select, matching the C-c C-? d / C-c C-? C-d bindings.
  • #3209: Fix cider-format dropping non-map cljfmt options (e.g. remove-consecutive-blank-lines?).
  • #3883: cider-jack-in-clj now restores the originating buffer when running its connect callback, matching the behavior of cider-jack-in-cljs and cider-jack-in-clj&cljs.
  • #3885: cider-locate-running-nrepl-ports now runs its ps/lsof probes via process-file, so endpoint completion for cider-connect works correctly from a TRAMP buffer (it inspects the remote host instead of the local one). Same for the lsof health check on .nrepl-port files.
  • #3885: cider-clojure-cli-command and cider-jack-in-default no longer freeze their auto-detection result at package load time. With the new nil default, CIDER picks the right command/tool at jack-in time, so installing Clojure (or moving it on PATH) no longer requires restarting Emacs.
  • #3885: cider--update-project-dir no longer reuses a single *cider-context-buffer* across calls. Each invocation gets a unique hidden buffer, so concurrent or interrupted jack-ins don't stomp each other.
  • #3885: nrepl-server-filter now treats wildcard/loopback printed bind addresses (localhost, 127.0.0.1, 0.0.0.0, ::1, ::) as "use the calling context", so jacking in over TRAMP to a server that prints localhost connects to the TRAMP host instead of the local machine.
  • #3886: cider--resolve-command now actually verifies command presence on remote hosts via executable-find's remote search, instead of unconditionally trusting the user-supplied command. A missing tool on the remote side now surfaces immediately during jack-in instead of as a server-startup failure later.
  • #3887: nrepl--ssh-tunnel-connect no longer routes its ssh invocation through a shell. The tunnel command is now spawned via start-process with an explicit arg list, eliminating shell-quoting hazards in user/host components.
  • #3894: Plug five request-id leaks in raw nREPL response handlers (cider/test-stacktrace, cider/test-var-query, cider/analyze-last-stacktrace, cider/ns-reload, cider/get-state). They never called nrepl--mark-id-completed, so their ids accumulated in the connection's nrepl-pending-requests for the lifetime of the session.
  • #3896: A response-handler error or an unrecognized response id no longer aborts the nREPL response queue. nrepl-client-filter wraps the dispatch call in with-demoted-errors, and the no-callback case in nrepl--dispatch-response is now a message instead of a hard error -- so a single misbehaving callback can no longer drop later responses on the floor.
  • #3897: nrepl-client-sentinel now tears down the SSH tunnel buffer/process when the client connection closes. Previously only the orderly cider-quit path killed the tunnel, so an abnormal disconnect (server crash, network drop) left the ssh subprocess as a zombie until Emacs exited.
  • #3898: Bound nrepl-completed-requests with a FIFO cap (nrepl-completed-requests-max-size, default 1000). The completed-request handler table previously grew unbounded for the lifetime of a connection; long-running sessions accumulated thousands of stale handler closures.
  • #3916: nrepl-bencode no longer crashes when handed a non-string scalar (symbol, float, etc.). The documented fallback ("everything else is encoded as string") used string-bytes directly, which errors on non-string input; values are now coerced via format before measuring byte length.
  • #3915: Fix cider-repl-history failing with "Unmatched bracket or quote" on its second invocation in a session when the user's history contained an entry with unbalanced parens. cider-repl-history-setup now erases the reused *cider-repl-history* buffer before re-entering cider-repl-history-mode, so any user-configured clojure-mode-hook (e.g. one that runs check-parens) runs on an empty buffer instead of stale content from the previous render.
  • #3918: cider--completing-read-port now defaults to 7888 when no running nREPL port can be inferred.

Changes

  • #3922: Project root detection no longer goes through clojure-mode/clojure-ts-mode. The new cider-project-dir walks up looking for any file in cider-build-tool-files; if none is found it falls back to project-current. Works in any buffer, including non-Clojure ones (e.g. M-x cider-connect from Dired).
  • #3924: The path-based fallback in cider-expected-ns no longer delegates to clojure-expected-ns. Inline the same algorithm using cider-project-dir and a new cider-directory-prefixes defcustom (mirroring clojure-directory-prefixes but owned by cider). No behavior change for files on the classpath (still preferred) or in a recognized project layout; removes the runtime dependency on clojure-mode for ns derivation.
  • #710: Use namespaced nREPL ops (e.g. cider/info instead of info) to match cider-nrepl 0.59+.
  • Bump the injected nrepl to 1.7.0.
  • Bump the injected cider-nrepl to 0.59.0.
  • #3788: Remove the cider-info-form eval fallback for cider-var-info. The info and lookup nREPL ops are now required.
  • Bump the injected nREPL version to 1.6.
  • #3868: Convert modern tuple-format indent specs (e.g. [[:block 1] [:inner 0]]) to legacy format for compatibility with older clojure-mode versions.
  • #3867: Rename cider-eval-spinner-type, cider-show-eval-spinner, and cider-eval-spinner-delay to cider-spinner-type, cider-show-spinner, and cider-spinner-delay. The old names are kept as obsolete aliases.
  • #3884: Replace cider-jack-in-universal-options with the more general cider-jack-in-tools registry; the old variable is removed. Anyone who customized it should migrate by calling cider-register-jack-in-tool instead.
  • #3928: Performance and correctness pass on the nREPL message logger:
    • nrepl-log-message no longer mutates the live response dict to attach its display timestamp. Response callbacks used to see a stray "time-stamp" key on freshly-arrived messages.
    • nrepl-log--pp-listlike now walks the plist in a single pass instead of copy-sequencing it through a sort/filter/concat pipeline. Specials (id, op, session, time-stamp) still print first but in canonical order, and the remaining keys now print in insertion order rather than alphabetically.
    • pp was swapped for prin1 in the non-dict leaf paths of nrepl-log-pp-object.
    • nrepl-message-buffer-max-size and nrepl-message-buffer-reduce-denominator are now defcustom to match their docstring intent.