Skip to content

Extract jack-in dependency injection into cider-jack-in.el#3902

Merged
bbatsov merged 1 commit into
masterfrom
extract-jack-in
May 10, 2026
Merged

Extract jack-in dependency injection into cider-jack-in.el#3902
bbatsov merged 1 commit into
masterfrom
extract-jack-in

Conversation

@bbatsov
Copy link
Copy Markdown
Member

@bbatsov bbatsov commented May 10, 2026

Moves the ~400-line "Jack-in dependencies injection" section out of cider.el into its own cider-jack-in.el module. Pure extraction — no behavior changes, just relocation.

The recently-added cider-register-jack-in-tool API made this clean: tool registrations still reference inject-fns by symbol (#'cider--clojure-cli-inject-deps etc.), so the registry plumbing keeps working unchanged. The handful of values cider-jack-in.el reads from cider.el (clojure-cli command/aliases, the registry itself) are forward-declared to avoid a circular require.

cider.el drops from 2207 to 1801 lines, and the deps-injection logic now lives in a single focused file rather than buried in the main entry-point module.

  • Compiles clean with eldev compile --warnings-as-errors
  • All 547 tests pass (eldev test)
  • No CHANGELOG entry — pure refactor with no user-visible change
  • The 7 checkdoc warnings on the new file (Returns/Removes/Creates → imperative) are pre-existing and were not addressed here to keep this diff a strict move

Move the ~400-line "Jack-in dependencies injection" section out of
cider.el and into its own module.  The new file holds:

- the deps/middleware/plugin defvars (cider-jack-in-dependencies,
  cider-jack-in-lein-plugins, cider-jack-in-nrepl-middlewares, etc.)
- per-tool jack-in command builders
  (cider-lein-jack-in-dependencies, cider-clojure-cli-jack-in-dependencies,
  cider-gradle-jack-in-dependencies, cider-shadow-cljs-jack-in-dependencies)
- inject-fns the tool registry dispatches to
  (cider--lein-inject-deps, cider--clojure-cli-inject-deps,
  cider--shadow-cljs-inject-deps, cider--gradle-inject-deps)
- shared helpers (cider--shell-quote-argument,
  cider--powershell-encode-command, cider--combined-aliases, etc.)

The recently-added cider-register-jack-in-tool API is the natural seam:
tools register an :inject-fn from this file, so cider.el only needs to
require cider-jack-in and the registry plumbing keeps working unchanged.
The few values cider-jack-in.el reads from cider.el (cider-clojure-cli-*,
cider-enable-nrepl-jvmti-agent, cider-jack-in-tools, cider--jack-in-tool)
are forward-declared to avoid a circular require.

cider.el drops from 2207 to 1801 lines.
@bbatsov bbatsov merged commit 3a257e2 into master May 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant