Skip to content

Unify cider-jack-in entry points around shared helpers#3883

Merged
bbatsov merged 1 commit intomasterfrom
lean-jack-in
Apr 27, 2026
Merged

Unify cider-jack-in entry points around shared helpers#3883
bbatsov merged 1 commit intomasterfrom
lean-jack-in

Conversation

@bbatsov
Copy link
Copy Markdown
Member

@bbatsov bbatsov commented Apr 27, 2026

The three jack-in entry points had drifted apart. cider-jack-in-clj went through cider--start-nrepl-server, but cider-jack-in-cljs and cider-jack-in-clj&cljs open-coded the param-update threading and called nrepl-start-server-process directly. Both cljs paths bothered to capture the originating buffer and re-enter it in the on-port callback; the clj path didn't, so its cider-connect-sibling-clj could fire in whatever buffer the user had switched to in the meantime.

This PR pulls the originating-buffer preservation into cider--start-nrepl-server so every caller gets it, then routes the cljs entry points through that helper and cider--update-params. The cljs-deps dynamic-let preamble shared between cider-jack-in-cljs and cider-jack-in-clj&cljs becomes a small cider--with-cljs-jack-in-deps macro.

Net result: the clj entry point's missing buffer preservation is fixed, ~30 lines of duplication go away, and the three commands now follow the same shape.

This is the first step of a broader cleanup of jack-in. Follow-ups planned: a project-type registry to collapse the five parallel pcase dispatches into one, and a documentation pass on the TRAMP story.

cider-jack-in-cljs and cider-jack-in-clj&cljs were open-coding the
param-update pipeline and calling nrepl-start-server-process directly,
while only cider-jack-in-clj went through cider--start-nrepl-server.
This left cider-jack-in-clj missing the originating-buffer preservation
that the cljs paths bothered to add by hand, so its connect callback
could fire in whatever buffer the user had switched to in the meantime.

Move the buffer preservation into cider--start-nrepl-server so all
callers get it, and funnel the cljs entry points through that helper
plus cider--update-params. Extract the cljs-deps dynamic-let into a
small cider--with-cljs-jack-in-deps macro shared by both cljs paths.
@bbatsov bbatsov merged commit e22b2e5 into master Apr 27, 2026
12 of 13 checks passed
@bbatsov bbatsov deleted the lean-jack-in branch April 27, 2026 22:32
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