summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorVitalie Spinu <spinuvit@gmail.com>2018-06-17 22:11:00 +0200
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2018-06-17 22:11:00 +0200
commit5cb98a74bad81a2cd15f8db86c469020ed030156 (patch)
tree04f1a2b78563fb2999cca5d6a27b2d45c6995e4e /doc
parent3e45c4ca592d67215bc22ca85d84dd87f74f5187 (diff)
New connection API and jack-in rewrite (#2324)
Second attempt on #2069. A brief description of the new functionality follows. 1) __Jack-in/connect__ - User level commands: Create new sessions: C-c M-j: cider-jack-in-clj C-c M-J: cider-jack-in-cljs C-c M-c: cider-connect-clj C-c M-C: cider-connect-cljs Add new REPLs to the current session: C-c M-s: cider-connect-sibling-clj C-c M-S: cider-connect-sibling-cljs - `cider-jack-in-clojurescript` no longer creates two repls, only the cljs repl - clj repl has no longer a special status of the "main" repl. All repls within a session share same server and are siblings of each other. You can create as many clj and cljs siblings as you want from any repl. - Creation of the client is no longer tightly bounded with the nrepl-server startup. The dynamic communication mechanism between jack-in and nrepl-server filter has been replace by a simple `on-port-callback`. 2) __New Connection and Session Management API__ - Connections (aka REPLs) are grouped in [sesman](https://github.com/vspinu/sesman) sessions. Sibling repls are added to the current session. - Cider connection commands (`cider-quit`, `cider-restart`, `cider-display-connection-info`) have been refactored to operate exclusively on the connection level. - Sesman commands operate on the whole session: ![sesman-map](https://user-images.githubusercontent.com/1363467/41355277-6864ffb8-6f21-11e8-9387-3de586477d68.png) - Associations (links) between current context (buffer, directory, project) are governed by sesman and could be formed only on the session level. In a nutshell, session can be linked to projects, directories and buffers. Buffer link have precedence over directory links, and directory have precedence over project links. When a sesman session is registered it's automatically linked with the lowest priority context (project, or directory if no project found). By default (configured with `sesman-1-to-1-links`) multiple sessions can be linked with a project or a directory, but only one session can be linked with a buffer. Cider functionality (eval, completion, repl-switching etc) operate on linked sessions. When there are multiple linked sessions ambiguity is automatically resolved by the recency of the REPL buffers (configured with `sesman-disambiguate-by-relevance`). - Show info on current links with `C-c C-s l`. Show info on current, linked or all sessions with `C-c C-s i`. - Micro-management of the server is not allowed (it's not useful and would complicate UI). All repls within a session share a server. Server can be either remote (`cider-connect`) or local (bootstraped within the emacs during `cider-jack-in-xyz`). In case of the local server, when the last connection is killed the server is automatically killed. `cider-restart` restarts the connection but not the server. `sesman-restart` restarts the server and all the connections. At least two issues I still plan to tackle here: - Restart of SSH tunneled connection has not been tested and probably doesn't work - REPL buffer naming system is no longer adequate. It should be possible to include session name as part of the buffer name and add more flexibility into the customization of buffer name templates. ----- A tot of no longer necessary or questionable functionality has been removed. The goal is to start from scratch and add only what is really necessary. I am listing all the removed functions for the ease of lookup through the github interface. Removed: cider--connection-host, cider--connection-port, cider--connection-project-dir, cider--connection-properties, cider--connection-type, cider--guess-cljs-connection, cider--has-warned-about-bad-repl-type, cider--in-connection-buffer-p, cider--quit-connection, cider--restart-connection, cider-assoc-buffer-with-connection, cider-assoc-project-with-connection, cider-change-buffers-designation, cider-clear-buffer-local-connection, cider-close-nrepl-session, cider-connections (variable), cider-current-connection (variable), cider-current-messages-buffer, cider-current-repl-buffer, cider-default-connection, cider-extract-designation-from-current-repl-buffer, cider-find-connection-buffer-for-project-directory, cider-find-reusable-repl-buffer, cider-make-connection-default, cider-map-connections, cider-other-connection, cider-project-connections, cider-project-connections-types, cider-prompt-for-project-on-connect, cider-read-connection, cider-repl-buffers, cider-replicate-connection, cider-request-dispatch, cider-rotate-default-connection, cider-toggle-buffer-connection, cider-toggle-request-dispatch, nrepl-connection-buffer-name-template, nrepl-create-client-buffer-function, nrepl-post-client-callback nrepl-prompt-to-kill-server-buffer-on-quit, nrepl-use-this-as-repl-buffer, Connection Browser Functionality: cider--connection-browser-buffer-name, cider--connection-ewoc, cider--connection-pp, cider--connections-close-connection, cider--connections-goto-connection, cider--connections-make-default, cider--connections-refresh, cider--connections-refresh-buffer, cider--ewoc-apply-at-point, cider--setup-connection-browser, cider--update-connections-display, cider-client-name-repl-type, cider-connection-browser, cider-connections-buffer-mode, cider-connections-buffer-mode-map cider-connections-close-connection, cider-connections-goto-connection, cider-connections-make-default, cider-display-connected-message, cider-project-name, Renamed: cider-current-session -> cider-nrepl-eval-session cider-current-tooling-session -> cider-nrepl-tooling-session cider-display-connection-info -> cider-describe-current-connection cider-create-sibling-cljs-repl -> cider-connect-sibling-cljs nrepl-connection-buffer-name -> nrepl-repl-buffer-name cider--close-connection-buffer -> cider--close-connection ## repl <> connection overlap cleanup cider-connections -> cider-repls cider-current-connection -> cider-current-repl cider-map-connections -> cider-map-repls cider-connection-type-for-buffer -> cider-repl-type-for-buffer cider-repl-set-type -> cider-set-repl-type
Diffstat (limited to 'doc')
-rw-r--r--doc/cider-refcard.tex3
-rw-r--r--doc/clojurescript.md2
-rw-r--r--doc/interactive_programming.md5
-rw-r--r--doc/managing_connections.md37
4 files changed, 6 insertions, 41 deletions
diff --git a/doc/cider-refcard.tex b/doc/cider-refcard.tex
index 6d877bd5..2b3d4ee1 100644
--- a/doc/cider-refcard.tex
+++ b/doc/cider-refcard.tex
@@ -125,8 +125,7 @@
\item[C-c M-p] cider-insert-last-sexp-in-repl
\item[C-c C-z] cider-switch-to-repl-buffer
\item[C-c M-o] cider-find-and-clear-repl-buffer
- \item[C-c M-d] cider-display-connection-info
- \item[C-c M-r] cider-rotate-default-connection
+ \item[C-c M-d] cider-describe-current-connection
\item[C-c M-n] cider-repl-set-ns
\item[C-c C-b] cider-interrupt
\item[C-c C-x] cider-refresh
diff --git a/doc/clojurescript.md b/doc/clojurescript.md
index 958a331b..897765de 100644
--- a/doc/clojurescript.md
+++ b/doc/clojurescript.md
@@ -100,7 +100,7 @@ You can also modify the known ClojureScript REPLs on a per-project basis using
```
You can also create a ClojureScript REPL with the command
-`cider-create-sibling-cljs-repl` in cases where you already have a
+`cider-jack-in-sibling-clojurescript` in cases where you already have a
Clojure REPL running.
Continue reading for the additional setup needed for the various ClojureScript
diff --git a/doc/interactive_programming.md b/doc/interactive_programming.md
index ba5ce55c..335715c4 100644
--- a/doc/interactive_programming.md
+++ b/doc/interactive_programming.md
@@ -37,8 +37,7 @@ Here's a list of `cider-mode`'s keybindings:
`cider-switch-to-repl-buffer` |<kbd>C-c C-z</kbd> | Switch to the relevant REPL buffer. Use a prefix argument to change the namespace of the REPL buffer to match the currently visited source file.
`cider-switch-to-repl-buffer` |<kbd>C-u C-u C-c C-z</kbd> | Switch to the REPL buffer based on a user prompt for a directory.
`cider-load-buffer-and-switch-to-repl-buffer` |<kbd>C-c M-z</kbd> | Load (eval) the current buffer and switch to the relevant REPL buffer. Use a prefix argument to change the namespace of the REPL buffer to match the currently visited source file.
-`cider-display-connection-info` |<kbd>C-c M-d</kbd> | Display default REPL connection details, including project directory name, buffer namespace, host and port.
-`cider-rotate-default-connection` |<kbd>C-c M-r</kbd> | Rotate and display the default nREPL connection.
+`cider-describe-current-connection |<kbd>C-c M-d</kbd> | Display default REPL connection details, including project directory name, buffer namespace, host and port.
`cider-find-and-clear-repl-output` |<kbd>C-c C-o</kbd> | Clear the last output in the REPL buffer. With a prefix argument it will clear the entire REPL buffer, leaving only a prompt. Useful if you're running the REPL buffer in a side by side buffer.
`cider-load-buffer` |<kbd>C-c C-k</kbd> | Load (eval) the current buffer.
`cider-load-file` |<kbd>C-c C-l</kbd> | Load (eval) a Clojure file.
@@ -67,7 +66,7 @@ Here's a list of `cider-mode`'s keybindings:
`cider-find-ns` |<kbd>C-c C-.</kbd> | Jump to some namespace on the classpath.
`cider-pop-back` |<kbd>M-,</kbd> | Return to your pre-jump location.
`complete-symbol` |<kbd>M-TAB</kbd> | Complete the symbol at point.
-`cider-quit` |<kbd>C-c C-q</kbd> | Quit the current nREPL connection. With a prefix argument it will quit all connections.
+`cider-quit` |<kbd>C-c C-q</kbd> | Quit the current nREPL connection.
There's no need to memorize this list. In any Clojure buffer with `cider-mode`
active you'll have a CIDER menu available, which lists all the most important
diff --git a/doc/managing_connections.md b/doc/managing_connections.md
index d425ad27..f6e67d33 100644
--- a/doc/managing_connections.md
+++ b/doc/managing_connections.md
@@ -8,35 +8,10 @@ You can connect to multiple nREPL servers using <kbd>M-x</kbd> `cider-jack-in`
CIDER maintains a list of nREPL connections and a single 'default'
connection. When you execute CIDER commands in a Clojure editing buffer such as
to compile a namespace, these commands are executed against a specific
-connection. This is controlled by the variable `cider-request-dispatch` - when
-it's set to `'dynamic` (the default), CIDER will try to infer which connection
-to use from the current project and currently visited file; when `'static`
-dispatch is used all requests will always be routed to the default connection
-(this was the default behavior in CIDER before 0.10).
-
-There's a handy command called `cider-toggle-request-dispatch`. You can use it
-to quickly switch between dynamic and static request dispatch. A common use-case
-for it would be to force temporary all evaluation commands to be using a
-particular (the default) connection.
+connection.
You can display the current nREPL connection using <kbd>C-c M-d</kbd>
-and rotate the default connection using <kbd>C-c M-r</kbd>. Another
-option for setting the default connection is to execute the command
-<kbd>M-x</kbd> `cider-make-connection-default` in the appropriate
-REPL buffer.
-
-## Connection browser
-
-You can obtain a list of all active connections using <kbd>M-x</kbd>
-`cider-connection-browser`. This buffer provides a few extra keybindings:
-
-Command |Keyboard shortcut | Description
--------------------------------------|--------------------------------|-------------------------------
-`cider-connections-make-default` |<kbd>d</kbd> | Make connection at point default.
-`cider-connections-close-connection` |<kbd>k</kbd> | Close connection at point.
-`cider-connection-browser` |<kbd>g</kbd> | Refresh connection browser.
-`cider-connections-goto-connection` |<kbd>RET</kbd> | Visit connection buffer.
-`cider-popup-buffer-quit-function` |<kbd>q</kbd> | Close window.
+and rotate the default connection using <kbd>C-c M-r</kbd>.
## Switch to connection buffer
@@ -50,11 +25,3 @@ came from.
The single prefix <kbd>C-u C-c C-z</kbd>, will switch you to the
relevant REPL buffer and set the namespace in that buffer based on
namespace in the current Clojure buffer.
-
-## Renaming connections
-
-To change the designation used for CIDER buffers use <kbd>M-x</kbd>
-`cider-change-buffers-designation`. This changes the CIDER REPL
-buffer, nREPL connection buffer and nREPL server buffer. For example
-using `cider-change-buffers-designation` with the string "foo" would
-change `*cider-repl localhost*` to `*cider-repl foo*`.