Function: cider-ensure-connected
cider-ensure-connected is a function alias for cider-ensure-session,
defined in cider-session.el.
This function is obsolete since 2.0.0; use cider-ensure-session
instead.
Signature
(cider-ensure-connected)
Documentation
Signal a user-error unless CIDER has a session available here.
The CIDER-level nREPL senders (e.g. cider-nrepl-send-request,
cider-nrepl-sync-request) already ensure a connection - they resolve the
REPL with cider-current-repl ENSURE - so commands don't need this for
correctness. Use it only to fail fast, before doing interactive or
side-effecting work, rather than at the point of the first request.
Mirror the resolution precedence of cider-current-repl and cider-repls:
honor a buffer pinned to a REPL (via cider--pinned-session) and a
cider-default-session before falling back to sesman's linked sessions.
Otherwise this guard would reject buffers where evaluation actually works,
such as a dependency's source jumped to via cider-find-var (which lives
outside the project and so has no linked session, only a pin - see
https://github.com/clojure-emacs/cider/issues/4120).
Aliases
cider-ensure-connected (obsolete since 2.0.0)