You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/modules/ROOT/pages/usage/managing_connections.adoc
+24-3Lines changed: 24 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ you're using the right connection. This problem was further compounded by the cr
26
26
* Eventually we introduced the concept of dynamic dispatch, where we'd use a combination of the filename extension and the project directory to figure out where to send operations. This approach worked reasonably well, but was problematic when you had multiple connections of the same type for the same project. There was also no logical grouping of related connections.
27
27
* This brings us to the present - today's approach to managing multiple connections is an evolution of the dynamic dispatch.
28
28
Related connections are grouped together in sessions, which are tied to some context (typically a project directory). If some
29
-
operation dispatch is ambiguous it will fail with an error message. You can manually link buffers, files and directories
29
+
operation dispatch is ambiguous it will fail with an error message. You can manually link (attach) buffers, files and directories
30
30
to sessions in such situations.
31
31
32
32
In the following sections we'll go over the basic terminology with respect to connection management, and we'll cover
@@ -43,7 +43,9 @@ sessions. Each session is a collection of connections which share the same nREPL
43
43
server. You can, however, have multiple sessions sharing the same nREPL server (although you're unlikely to
44
44
ever need this).
45
45
46
-
Start new sessions with
46
+
=== Starting New Sessions
47
+
48
+
You can start new sessions with the following commands:
47
49
48
50
* kbd:[C-c C-x j j] (`cider-jack-in-clj`)
49
51
* kbd:[C-c C-x j s] (`cider-jack-in-cljs`)
@@ -52,11 +54,30 @@ Start new sessions with
52
54
* kbd:[C-c C-x c s] (`cider-connect-cljs`)
53
55
* kbd:[C-c C-x c m] (`cider-connect-clj&cljs`)
54
56
55
-
Add new REPLs to the current session with
57
+
If a command creates multiple REPLs (e.g. `cider-jack-in-clj&cljs`) they are going to be added to the same session.
58
+
59
+
You'll normally get a warning if you try to create a new session for
60
+
some project if there's already an existing session for it (e.g. after
61
+
running `cider-jack-in-cljs` after `cider-jack-in-clj` for the same
62
+
project). Generally in such cases it's preferred to use commands that
63
+
can add more REPLs to the existing session. We'll cover those in the next section.
64
+
65
+
=== Adding REPLs to a Session
66
+
67
+
You can add new REPLs to the current session with:
56
68
57
69
* kbd:[C-c C-x s j] (`cider-connect-sibling-clj`)
58
70
* kbd:[C-c C-x s s] (`cider-connect-sibling-cljs`)
59
71
72
+
A very common use-case would be to run `cider-jack-in-clj` for some project and then follow up with `cider-connect-sibling-cljs`.
73
+
74
+
NOTE: Unless there are both Clojure and ClojureScript REPLs in the same session smart-dispatch commands (e.g. evaluate the code
75
+
in the right Clojure/ClojureScript REPL, toggle between Clojure and ClojureScript REPL) won't work. A very common problem
76
+
newcomers experience is to create a Clojure REPL and a ClojureScript REPL in separate sessions and wonder why those are not
77
+
interacting properly with one another.
78
+
79
+
=== Session Life-Cycle Management
80
+
60
81
Session life-cycle management commands live on the https://github.com/vspinu/sesman[Sesman] keymap (kbd:[C-c C-s])
0 commit comments