Skip to content

Commit f564626

Browse files
committed
Touch up the previous commit
1 parent 71a8d67 commit f564626

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
### New Features
66

7-
- Introduce `cider-start-nrepl-server` which does the same as `cider-jack-in` but without trying to connect to the started
8-
nREPL server.
7+
- [#3555](https://github.com/clojure-emacs/cider/pull/3555): Introduce `cider-start-nrepl-server` which does the same as `cider-jack-in`
8+
but without trying to connect to the started nREPL server.
99

1010
### Changes
1111

@@ -17,7 +17,7 @@ nREPL server.
1717
- Improves keyword completion for ClojureScript.
1818
- [#3553](https://github.com/clojure-emacs/cider/issues/3553): `cider-pprint-eval-last-sexp`, `cider-eval-last-sexp-to-repl`, `cider-pprint-eval-last-sexp-to-repl`: use error overlays to indicate failure.
1919
- this also avoids showing an empty `*cider-result*` buffer.
20-
- [#3554](https://github.com/clojure-emacs/cider/issues/3554): CIDER macroexpand: handle errors more gracefully.
20+
- [#3554](https://github.com/clojure-emacs/cider/issues/3554): CIDER macroexpand: handle errors more gracefully.
2121

2222
### Bugs fixed
2323

cider.el

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,8 +1305,8 @@ nil."
13051305
(define-key map (kbd "j n") #'cider-start-nrepl-server)
13061306
(define-key map (kbd "C-j j") #'cider-jack-in-clj)
13071307
(define-key map (kbd "C-j s") #'cider-jack-in-cljs)
1308-
(define-key map (kbd "C-j n") #'cider-start-nrepl-server)
13091308
(define-key map (kbd "C-j m") #'cider-jack-in-clj&cljs)
1309+
(define-key map (kbd "C-j n") #'cider-start-nrepl-server)
13101310
(define-key map (kbd "C-j C-j") #'cider-jack-in-clj)
13111311
(define-key map (kbd "C-j C-s") #'cider-jack-in-cljs)
13121312
(define-key map (kbd "C-j C-m") #'cider-jack-in-clj&cljs)
@@ -1330,20 +1330,20 @@ nil."
13301330
"CIDER jack-in and connect keymap.")
13311331

13321332
(defun cider--start-nrepl-server (params &optional on-port-callback)
1333-
"Starts an nrepl server and passes the callback to it.
1333+
"Start an nREPL server.
13341334
PARAMS is a plist optionally containing :project-dir and :jack-in-cmd.
1335-
ON-PORT-CALLBACK is a function of one argument (server buffer)
1335+
ON-PORT-CALLBACK (optional) is a function of one argument (server buffer)
13361336
which is called by the process filter once the port of the connection has
1337-
been determined. Can be nil."
1337+
been determined."
13381338
(nrepl-start-server-process
13391339
(plist-get params :project-dir)
13401340
(plist-get params :jack-in-cmd)
13411341
on-port-callback))
13421342

1343-
13441343
(defun cider--update-params (params)
1345-
"Completes the passed in PARAMS from user input.
1346-
Updates :project-dir, confirmation for existing session and :jack-in-cmd."
1344+
"Fill-in the passed in PARAMS plist needed to start an nREPL server.
1345+
Updates :project-dir and :jack-in-cmd.
1346+
Also checks whether a matching session already exists."
13471347
(thread-first
13481348
params
13491349
(cider--update-project-dir)
@@ -1363,11 +1363,10 @@ double prefix prompt for all these parameters."
13631363
(lambda (server-buffer)
13641364
(cider-connect-sibling-clj params server-buffer)))))
13651365

1366-
13671366
(defun cider-start-nrepl-server (params)
13681367
"Start an nREPL server for the current project, but don't connect to it.
13691368
PARAMS is a plist optionally containing :project-dir and :jack-in-cmd.
1370-
With the prefix argument, allow editing of the start server in command; with a
1369+
With the prefix argument, allow editing of the start server command; with a
13711370
double prefix prompt for all these parameters."
13721371
(interactive "P")
13731372
(cider--start-nrepl-server (cider--update-params params)))

doc/modules/ROOT/pages/basics/up_and_running.adoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,9 @@ would therefore fail.
276276
This assumes that the user will execute a `cider-connect` command manually afterwards,
277277
specifying host/port.
278278

279-
For this scenario, the `cider-start-nrepl-server` kbd:[j n] command is offered, which optionally
279+
For this scenario, the `cider-start-nrepl-server` (kbd:[C-c C-x (C-)j (C-)n]) command is provided, which
280280
takes the same parameters as `cider-jack-in`.
281281

282-
283282
== Connect to a Running nREPL Server
284283

285284
If you have an nREPL server already running, CIDER can connect to
@@ -372,7 +371,7 @@ By 'containers' we mean Docker containers, or similar technologies, for running
372371
The files which we edit may / may not be edited using TRAMP. They could as well be mounted inside the container, so they appear as local.
373372

374373
Because CIDER can't always detect if it's dealing with remote files, it's advisable to not rely on `cider-jack-in`
375-
and its remote support described above, but to
374+
and its remote support described above, but to
376375
start the nREPL server via command line from inside the container, and `cider-connect` to it.
377376

378377
This requires to first get a shell inside the running container and then start a nREPL server manually,
@@ -384,7 +383,7 @@ There are several solutions for this depending on the concrete scenario.
384383

385384
=== Working with Containers running on localhost
386385

387-
The nREPL port should be set to a fixed value as we need to give this during the `docker start` command in order to forward the port from
386+
The nREPL port should be set to a fixed value as we need to give this during the `docker start` command in order to forward the port from
388387
container to host. This requires as well that nREPL server listens to "0.0.0.0" and not only to "localhost".
389388

390389
=== Working with Containers running on remote hosts
@@ -401,7 +400,7 @@ https://containers.dev[Development Containers] is a standard to describe contain
401400
It uses Docker/Podman behind the scenes. So the principles of making sure that the nREPL port becomes available stay the same,
402401
but there are slightly different ways to configure this (given by the devcontainer standard).
403402

404-
There are several CLI tools to manage devcontainers, as there are several container technologies. The following example uses
403+
There are several CLI tools to manage devcontainers, as there are several container technologies. The following example uses
405404
link:https://github.com/devcontainers/cli[the devcontainers cli], but there are others (devpod, gitpod...).
406405

407406
==== Example: Working with containers (using `devcontainer`) on a remote server

0 commit comments

Comments
 (0)