Changelog
July 16, 2026 · View on GitHub
Unreleased
4.0.0 (2026-07-16)
-
(Breaking) Require Emacs 28.1+.
-
(Breaking) Require CIDER 2.0+ (and drop the small compat shims for the pre-2.0 API names).
-
Use refactor-nrepl's namespaced op names (
refactor/find-symbol,refactor/clean-ns, …) when the middleware advertises them (refactor-nrepl 3.13.0+, the injected version is now 3.14.0), falling back to the bare names on older versions. refactor-nrepl treats the namespaced forms as canonical and plans to drop the bare names, and namespacing avoids op-name collisions with other middleware. -
Don't error out of
cider-connected-hookwhen the refactor-nrepl middleware is missing: the connect-time version probe now degrades to the existing "out of sync" warning instead of aborting the startup checks with a cryptic error (visible with CIDER 2.0, whose senders reject unsupported ops client-side). -
Fix the offline ns-form sort (
cljr-clean-nsandcljr-auto-sort-nswithout a REPL) silently doing nothing inclojure-ts-modebuffers, where the tree-sitterforward-sexp-functionbrokeclojure-sort-ns. -
cljr-rename-symbol,cljr-find-usages,cljr-inline-symbolandcljr-change-function-signaturenow send an explicitignore-errorsvalue that matchescljr-ignore-analyzer-errors, instead of a nil value that was dropped on the wire. With the default (nil) this means the strict behavior the option documents actually takes effect - a project with an unanalyzable namespace now surfaces a warning rather than silently skipping it. -
cljr-slashno longer sends the obsoletelanguage-contextparameter to thesuggest-libspecsop (superseded bybuffer-language-context/input-language-contextin refactor-nrepl 3.7.0). -
The asynchronous refactorings (
cljr-rename-symbol,cljr-change-function-signature,cljr-rename-file-or-dir) now show a mode-line spinner while the middleware is working, so it's clear the operation is still running. Uses CIDER's spinner, so it honorscider-show-spinnerand friends. -
cljr-rename-symbolandcljr-change-function-signaturenow find their occurrences asynchronously. Locating every occurrence analyses the whole project, which on a cold cache or a large project could freeze Emacs for a long time; now the command returns immediately and the rename (or the change-signature edit buffer) happens once the search finishes, so Emacs stays responsive meanwhile. As a side effect they now also honorcljr-middleware-ignored-paths. -
cljr-rename-file-or-dirnow runs asynchronously. Renaming a file rewrites references to it across the whole project, which can take a while; instead of freezing Emacs on a synchronous round-trip, the command returns immediately and finishes (renaming the file, revisiting affected buffers) once the middleware responds. -
Preview project-wide refactorings before they touch disk.
cljr-rename-symbol,cljr-change-function-signatureandcljr-inline-symbolnow gather all their edits first and show them as a diff, and nothing is written until you confirm. Controlled by the newcljr-preview-refactorings(default on); set it to nil for the old apply-immediately behavior. -
New
cljr-undo-last-refactoringreverts every file changed by the last applied rename or change-signature in one step (bound tour, and inclj-refactor-menu). -
cljr-change-function-signaturecan now add and remove parameters, not just reorder and rename them. In the edit buffer,aadds a parameter (you're prompted for its name and a placeholder to insert at call sites) andk/dmarks one for removal. Added parameters get their placeholder inserted at every call site; removals are never auto-deleted (an argument might have side effects) - the affected call sites are routed to the manual-intervention buffer for review. -
cljr-change-function-signaturenow handles multi-arity functions. It asks which arity to change, then updates only that arity's definition and the call sites whose argument count matches (call sites of other arities are left alone). Run it once per arity to change several. -
Fix
cljr-change-function-signatureerroring with "Can't do work on functions of multiple arities" on ordinary single-arity functions. It parsed the middleware'sarglists-strassuming an outer-paren format that current CIDER no longer sends, which had broken even the existing reorder/rename against a live REPL. -
cljr-clean-nsdegrades gracefully without a REPL. When theclean-nsmiddleware op isn't available it falls back to sorting the ns form with clojure-mode'sclojure-sort-nsinstead of erroring - pruning unused libspecs still needs the middleware and is skipped. Auto-sort after ns changes (cljr-auto-sort-ns) now works offline too. -
Fix
cljr-slashandcljr-add-missing-libspecerroring with "No linked CIDER sessions" when used without a connected REPL, instead of falling back to their offline behavior.cljr--op-supported-pnow returns nil when disconnected rather than signaling. -
Performance: the background artifact-list warming (on REPL connect, per
cljr-populate-artifact-cache-on-startup) now populates the Emacs-side cache, not just refactor-nrepl's server-side one. Previously the firstcljr-add-project-dependency/cljr-update-project-dependencystill blocked on the full artifact-list transfer even though a warmer had already run; now that common case is served from cache without a middleware round-trip. -
(Breaking) Remove the deprecated
namespace-aliasescode path fromcljr-slash, along with thecljr-slash-uses-suggest-libspec,cljr-suggest-namespace-aliasesandcljr-assume-language-contextdefcustoms.cljr-slashhas used the language-context-awaresuggest-libspecsop (with an offline fallback) by default for a while now; the old path and its options are gone. -
cljr-promote-function: promoting a#(...)literal to(fn ...)now works without a REPL - it delegates to clojure-mode'sclojure-promote-fn-literalinstead of a home-grown, less robust converter. Only thefn->defnpromotion (which needs captured-locals analysis) still requires the middleware, and it no longer shows the "the project will be evaluated" warning for the pure literal case. -
cljr-remove-letnow works without a REPL. It inlines the let's bindings locally - in reverse order, so a binding that refers to an earlier one still resolves - and removes the let, instead of drivingcljr-inline-symbol(which required the middleware and showed the "the project will be evaluated" warning once per binding). -
Fix
cljr-add-declarationtreating a name as "already declared" when it merely contains, or is contained by, another symbol - names with regexp specials like*db*orvalid?were matched incorrectly. -
cljr-describe-refactoringnow opens the refactoring's wiki page in your browser. The previous in-Emacs rendering scraped the wiki's HTML, which broke when GitHub changed its markup and 404'd for the clojure-mode commands in the menu; the candidate list is now limited to thecljr-*commands that actually have wiki pages. This also drops thesgml-modedependency. -
cljr-add-project-dependency/cljr-update-project-dependency: give a clear error instead of a raw "search failed" when the project file has no:deps/:dependencies, and drop a stray, no-op middleware check after hotloading. -
(Deprecation)
cljr-introduce-letandcljr-move-to-letare now obsolete aliases for clojure-mode'sclojure-introduce-let/clojure-move-to-let(they were already thin wrappers). The keybindings and menu now point at theclojure-*commands directly. -
cljr-move-formnow picks the target file withread-file-name(honoring your completion framework) instead of hardcodingido-find-file. -
cljr-cycle-threadnow reports a clear error when point isn't inside a threading macro, instead of silently doing nothing. -
Surface
cljr-reify-to-defrecordinclj-refactor-menu(it had no keybinding or menu entry, so it was effectively undiscoverable). -
cljr-add-missing-libspecdegrades gracefully without a REPL. For an aliased symbol likestr/join, when refactor-nrepl'sresolve-missingop isn't available (or finds nothing) it now falls back tocljr-magic-require-namespaces- so common aliases still work offline, and a missing library can be added and hotloaded (seecljr-slash-add-missing-libs). Previously it errored without a connected REPL. -
cljr-slashnow works without a running REPL. When refactor-nrepl'ssuggest-libspecsop isn't available, it falls back to the staticcljr-magic-require-namespacestable (honoring each entry's:onlylanguage context) instead of erroring, so common aliases likestr/iostill get required before you jack in. -
cljr-slashcan add and hotload a missing library. Entries incljr-magic-require-namespacesmay now carry an:artifactcoordinate (e.g.("json" "cheshire.core" :artifact "cheshire/cheshire")); when the namespace isn't on the classpath,cljr-slashoffers to add that artifact as a project dependency and hotload it. Controlled by the newcljr-slash-add-missing-libs(default on). -
Add
clj-refactor-menu, atransientmenu of all commands grouped by category (bound tohhunder your keybinding prefix, e.g.C-c C-m hh). It mirrors the two-letter keybindings, so it doubles as a way to learn them, and its Options section toggles common settings for the session. -
Surface clojure-mode's collection-type conversions (
clojure-convert-collection-to-list/-map/-vector/-set/-quoted-list) inclj-refactor-menuunder "Convert collection to", so they're discoverable from clj-refactor. -
Performance: project-wide refactorings (rename symbol, inline symbol, change function signature) no longer leave behind buffers they had to open, which previously slowed Emacs down on large renames.
-
cljr-project-cleannow shows a progress reporter instead of freezing Emacs silently. -
Performance: cache the artifact and version lists fetched by the dependency commands, so they aren't re-requested on every invocation. The TTL is configurable via
cljr-artifact-cache-ttl(default 300s; set to nil to disable). -
Performance:
cljr-slashcaches libspec suggestions per alias (also governed bycljr-artifact-cache-ttl), so repeatedly typing an unresolved alias likestr/no longer does a middleware round-trip on every/. -
(Breaking) Drop the
multiple-cursors,hydraandinflectionsdependencies.- The hydra menus are replaced by the new
clj-refactor-menutransient (see above). - The
multiple-cursorsintegration is gone; let/extract/promote refactorings now always prompt for names. Thecljr-use-multiple-cursorsoption is removed. - Parameter-name guessing in
cljr-create-fn-from-examplenow uses a small built-in inflector instead ofinflections.
- The hydra menus are replaced by the new
-
(Breaking) Remove the
cljr-thread,cljr-thread-first-all,cljr-thread-last-all,cljr-unwind,cljr-unwind-all,cljr-cycle-privacy,cljr-cycle-if,cljr-cycle-coll,cljr-thread-all-but-last,cljr-use-metadata-for-privacyandcljr-find-usages-ignore-analyzer-errorsaliases, all deprecated back in 2.3.0. Use theclojure-*equivalents (now in clojure-mode) andcljr-ignore-analyzer-errors. -
Use CIDER 1.23's renamed nREPL API (
cider-nrepl-sync-request,cider-ensure-session) when available, while staying compatible with older CIDER releases. Fixes byte-compilation warnings against recent CIDER. -
Re-enable
cljr-hotload-dependency, now that refactor-nrepl hotloads dependencies on top ofclojure.tools.deps(refactor-nrepl #231). It also acceptsdeps.edn-style coordinate maps in addition to Leiningen vectors.
3.12.0
clean-nswill now also reformat thensform for whitespace-only changes, if needed.- Previously, this wasn't possible since refactor-nrepl generally only works at the structural level.
- Use refactor-nrepl 3.10.0.
3.11.3
- Fix incorrectly serialized values for
cljr-slashwhen usingcljr-suggest-libspecs.
3.11.2
3.11.1
- #555: expand default
cljr-magic-require-namespacesaliases. - #555: Handle an edge case for
cljr-slash.
3.11.0
- #554: Enable
cljr-slash-uses-suggest-libspecby default.
3.10.0
- #552: support TRAMP connections.
3.9.4
- Fix
cljr-version.
3.9.3
- Internal: avoid the use of deprecated Elisp functions.
3.9.2
3.9.1
- #430
cljr-add-missing-libspec: produce more friendly prompts. cljr-add-missing-libspec: don't suggest members that are already interned into the current namespace.- e.g. the class
Threador the var+are already interned by default in Clojure namespaces, so they are redundant to suggest or insert into thensform.
- e.g. the class
3.9.0
3.8.0
- Upgrade refactor-nrepl.
- Restore Emacs 26 compatibility.
3.7.1
3.7.0
- Upgrade refactor-nrepl.
- #537: Fail early in
cljr-rename-symbolin case narrowing is in effect.
3.6.1
- Add the clojure.math namespace to magic requires (new with Clojure 1.11.0)
3.6.0
- [#532] Introduce
cljr-slash-uses-suggest-libspecto use the language context awaresuggest-libspecmiddleware for alias to libspec suggestions. - Upgrade refactor-nrepl.
3.5.6
3.5.5
3.5.4
3.5.3
- Upgrade
cider,parseednandinflectionsdependencies.
3.5.2
- Use refactor-nrepl 3.5.2.
3.5.1
- Use refactor-nrepl 3.5.1.
3.5.0
- Use refactor-nrepl 3.5.0.
- Improve integration with Clojure 1.11's new
:as-aliasnamespace directive.
3.4.3
- Use refactor-nrepl 3.4.2.
3.4.2
3.4.1
- Introduce
cljr-suggest-namespace-aliasesdefcustom.
3.4.0
3.3.3
- Adapt
cljr--inject-jack-in-dependenciesto upstream changes in CIDER.
3.3.2
- Use refactor-nrepl 3.3.2.
3.3.1
- Use refactor-nrepl 3.3.1.
3.3.0
- Use refactor-nrepl 3.3.0.
3.2.3
- Use refactor-nrepl 3.2.2.
3.2.0, 3.2.1, 3.2.2 (2021-11-16)
- #504: Introduce
cljr-print-right-margin,cljr-print-miser-widthcustomization options which control the line wrapping of ns forms after formatting them (as performed afterclean-ns,rename-file-or-dir, etc).
3.1.0 (2021-11-10)
3.0.0 (2021-10-25)
- #483: Improve performance of
cljr-slashwhen typing fraction literals. - #482: Add missing defgroup form.
- #470: Choose
deps.ednoverpom.xmlas project file. - Introduce
cljr-insert-newline-after-requireoption. - Introduce
cljr-injected-middleware-versionoption, allowing users to customize the refactor-nrepl version to be used. - Dropped support for Emacs 25 (to match upstream changes in CIDER).
2.5.1 (2021-02-16)
- #442: Send nREPL-based paths instead of CIDER-based paths.
- #465: Fix breakage in
cljr-rename-symbol. - Automatically namespace artifacts in
deps.edn.
2.5.0 (2020-02-29)
- #455: Added support for detecting shadow-cljs projects.
- #402:
cljr-stop-referring: do not alter strings. - #380:
cljr-clean-ns: fixFileNotFoundException, by trying both the absolute path and the path relative to the project root. This requires a new refactor-nrepl, old versions will only check the absolute path.
2.4.0 (2018-08-26)
- Compatible with CIDER 0.17 and 0.18.
- Hotload dependency temporarily disabled to make the middleware run on Java 10.
- Dropped support for Emacs < 25.1 (to match clojure-mode and CIDER).
- #426: New variable,
cljr-middleware-ignored-paths, to make the middleware ignore certain paths. - #408: New
cljr-before-warming-ast-cache-hook,cljr-after-warming-ast-cache-hookcallbacks around AST warming. - #394: New config option
cljr-assume-language-context: by default, when clj-refactor encounters an ambiguous context (clj vs cljs) it creates a popup asking user which context is meant. If this option is changed to "clj" or "cljs", clj-refactor will use that as the assumed context in such ambiguous cases. - #391: Prevent refactor-nrepl from being injected when starting a REPL outside a project, and add an option
cljr-suppress-outside-project-warningto suppress the resultant warning.
2.3.1 (2017-07-04)
- #363 cljr-favor-prefix-notation by default is set to false
- Display keymap bindings in documentation for minor mode
- New config setting
cljr-libspec-whitelistto prevent libspecs which appear unused but are side-effecting at load from being pruned. - #301:
adhas gained a prefix to declare the symbol under the cursor. - #312: Allow
sutalias to be customized. - #305: Don't call lookup-alias for non namespaced keywords at all when slash is typed. However trigger lookup alias with the leading :: stripped off the prefix if the keyword is namespaced.
- Require a custom test framework for Clojurescript test files. By default it's
cljs.testbut it can be customized withcljr-cljs-clojure-test-declaration.
Changes
- #302:
adnow understands def-like things, e.g. defs created by Schema. - When inserting ns form to blank clojure-ish file, check if cider is available and connected for better detecting the expected namespace.
- Remove the warning about missing nREPL ops.
- Remove threading macro related features because they are moved to Clojure mode. However, the usual mnemonics for these features still work only they reference the Clojure mode implementations.
- Remove cycle privacy, cycle if and cycle collection type features. They are moved to Clojure mode. The usual mnemonics for cycle privacy and cycle if features still work only they refer the Clojure mode implementations. Cycle collection type got reworked into convert collection to list, quoted list, map, vector and set. Cycle collection type is no longer supported.
- Compatible with clojure-mode 5.6.1 and above.
- Remove most of the code implementing
letrelated refactorings because these featured got migrated and reworked in Clojure mode. The usual mnemonics for these features still work and also a version of these features using multiple cursors are still maintained here as multiple cursors mode is not supported in Clojure mode. - #294: Remove dash library dependency.
- #372: Remove s.el dependency
Bugs fixed
- #368: Fix inline symbol fails on inlining composed function in a
def - #299:
mlmoves cursor - #309:
amcreates alias for fully-qualified symbols. - #313: teach
pfabout function literals using%&. - #320:
*data-readers*ignored when searching for macros. - #339: Teach stop refer to understand multiline refer clauses.
- #341: Avoid creating circular dependencies with move form when source namespace refers to the target namespace with a require.
- refactor-nrepl#183 Applied conversion between Unix-like path generated by Emacs under Cygwin and Windows-like path required by nREPL. Cider functions
cider-to-nrepl-filename-functionandcider-from-nrepl-filename-functionare used. - Fix
cljr--normalize-symbol-namewhen the symbol name starts with#'. - #371: Stop
cljr-slashmessing up(in-ns ...)forms
2.2.0 (2016-03-22)
- Smarten up
cljr-stop-referringto replace:refer :allstyle require with alias and apply the alias to all occurrences of symbols from the referred namespace. - #292: The buffer wasn't saved after adding a missing libspec causing clean-ns to act on stale data.
- Don't try to resolve
js/in cljs-mode cljr-create-fn-from-exampleimprovements: strip ns off keywords when making param name; always include a blank line over new function- #306: Add-require doesn't jump back if there is no REPL connection with refactor-nrepl configured
Changes
- Compatible with CIDER 0.11
- Follow up CIDER 0.11 injecting its own dependencies at
cider-jack-inby adding clj-refactor's own dependencies to the appropriate vars in CIDER. Both leiningen and boot are supported. Setcljr-inject-dependencies-at-jack-into nil to opt out.
2.0.0 (2016-02-06)
- #267:
Add
cljr-require-macrowhich requires a macro into the current namespace. - Add prefix variant to
cljr-add-import-to-nsfor insertion of imports in the cljs part of the ns declaration. - Add prefix variant to
cljr-add-use-to-nsfor insertion of 'use' in the cljs part of the ns declaration. - Add prefix variant to
cljr-add-requirefor insertion of requires in the cljs part of the ns declaration. - Boot support for
cljr-clean-ns. - Boot support for
cljr-sort-project-dependencies. - Boot support for
cljr-update-project-dependencies. - Boot support for
cljr-update-project-dependency. - #228: Boot support for
cljr-add-project-dependency. - Get rid of
cljr-reload-config. We're now sending the configuration options down to the middleware on each request instead of storing it down there. - Make magic requires cljc aware.
- #215: Improve the magic requires feature (when you hit
/) by asking the middleware for all available namespace aliases. - Add
cljr-extract-defwhich extracts the form at, or around, point as a def. - Add
cljr-change-function-signatureto re-order or re-name function parameters. - Keep pressing
laftercljr-expand-letto expand further. - refactor-nrepl#99: if cljr-thread-first-all or cljr-thread-last-all is called with a prefix the last expression is not threaded. cljr-thread-all-but-last defcustom has the same effect without the prefix
- hydra menus for discoverability: they help to (re)learn clj-refactor key bindings. See: parent hydra.
Bugs fixed
- #285: clean-ns did the wrong thing unless the code was loaded.
Changes
- #265: Feedback to the user is lost among other general messages from emacs.
- Make
cljr-clean-nsthe only default function used bycljr-project-clean. - Remove
cljr-remove-unused-requireswhich is replaced bycljr-clean-ns. - Remove
cljr-replace-usewhich is replaced bycljr-clean-ns. - Remove
cljr-sort-nswhich is replaced bycljr-clean-ns. cljr-remove-debug-fnshas been removed.cljr-magic-require-namespacesis now only consulted in the event the namespace alias isn't already used in the project.- #217: When requiring the test framework in test files stop favoring
:refer :all. - #217: Add a bunch of defcustoms to parameterise what gets inserted into the test namespaces for the various test frameworks.
- #216: Teach our automatic ns generator about cljc files.
- Teach
cljr-extract-constantabout the^:consthint to the compiler. - Use yasnippet for placeholder parameters in
cljr-create-fn-from-example - Highlight the function be promoted with overlays in
cljr-promote-function. - Highlight the form to be extracted with overlays in
cljr-extract-function. cljr-create-fn-from-exampleis now significantly smarter about guessing parameter numbers and names.cljr-sort-nsno longer marks the buffer as changed if it did no work.cljr-rename-symbolnow fails earlier, before prompting the user for a new name if an AST can't be built due to errors.- support for emacs 24.3 and older is dropped
- refactor-nrepl#85: Eliminate some find usages duplicates
- Some AST based features (find usages, rename symbol, inline symbol) ignore namespaces that cannot be analyzed if
cljr-ignore-analyzer-errorsset to true instead of failing entirely. - By default warning is given when AST based feature is used and clj-refactor only proceeds with it if the user allowed evalling the project as the analyzer also evals first level forms. To disable the warning set
cljr-warn-on-evaltonil. This also reenables warming AST cache at startup of the REPL.
1.1.0 (2015-07-06)
- Add
cljr-describe-refactoringwhich shows the wiki page describing one of the available refactorings inline in emacs. - Add
cljr-rename-file-or-dirto replacecljr-rename-file. - Add
cljr-inline-symbolwhich replaces the symbol at point with its definition. - Add
cljr-add-stubswhich adds a skeleton implementation of the protocol or interface at point. - Add
cljr-reify-to-defrecord - Add
cljr-show-changelogso users don't have to visit github to find out what's changed after a package update. - Add
cljr-create-fn-from-exampleto create function stub based on example usage - Add
cljr-update-project-dependencies(for leiningen only) prompts to update dependencies in project.clj, listing available versions - Now
cljr--add-test-use-declarationsactually checks the file system in order to find its require for the source ns. - Improvements to error handling and reporting around analyzing namespaces
- Configuration option
cljr-find-usages-ignore-analyzer-errors: when true, find-usages will run even if there are compilation/analyzer problems in some namespaces; defaults to nil. - Configuration option
cljr-favor-private-functions: set to nil to create public functions where applicable. - Better support for
cljr-use-metadata-for-privacywhen creating functions. - Highlight the relevant form when extracting and promoting functions.
- Multiple cursors is used when extracting and promoting functions (disable by setting
cljr-use-multiple-cursorsto nil) - Not using multiple-cursors when in evil-mode.
1.0.5 (2015-05-02)
- Add
cljr-reload-configto resubmit config settings to the middleware - Add config setting for
clean-nsto not do rewriting to favor prefix form. - Add
cljr-extract-function - Add
cljr-hotload-dependency - Hotloading of artifacts added with
cljr-add-project-dependency - Add
cljr-remove-let - Add
cljr-clean-ns - Add
cljr-add-missing-libspec - Add
cljr-promote-function - Add
cljr-find-usages - Add
cljr-rename-symbol
0.13 (2014-11-19)
- Removed
cljr-cycle-stringlike. This function was duplicating the functionality ofclojure-modesclojure-toggle-keyword-string - Add
cljr-cycle-if - Common namespace shorthands are (optionally) automatically required when you type it.
- Comparator for sort require, use and import is configurable, add optional length based comparator to sort longer first
- Add semantic comparator to sort items closer to the current namespace first
- Add
cljr-project-cleanwith configurable clean functions - Add
cljr-sort-project-dependencies - Add
cljr-add-project-dependency - Add
cljr-remove-debug-fns - performance tweak for
cljr-remove-unused-requiresifrefactor-nreplis used
0.12 (2014-03-03)
- When expanding let, or moving expressions to let, it now replaces duplicates in the let body with the bound name.
0.11 (2014-02-20)
- Add
cljr-raise-sexp - Add
cljr-remove-unused-requires - Add
cljr-move-form
0.10 (2014-01-30)
- Add
cljr-stop-referring - Add
cljr-destructure-keys - Add
cljr-sort-ns
0.9 (2014-01-26)
- Add
cljr-replace-use - Add
cljr-add-declaration
0.8 (2014-01-20)
- Add
cljr-cycle-stringlike - Add
cljr-cycle-coll - Add
cljr-cycle-privacy
0.7 (2014-01-15)
- Add
cljr-thread-first-all,cljr-thread-last-allandcljr-unwind-all
0.6 (2014-01-11)
- Add
cljr-move-to-let