Function: cider-ns-loaded-p

cider-ns-loaded-p is a byte-compiled function defined in cider-client.el.

Signature

(cider-ns-loaded-p &optional NS)

Documentation

Return non-nil when NS is loaded in the connected runtime.

NS defaults to the current namespace. Consults the track-state namespace cache first - which is free, but only populated when cider-nrepl is present - and otherwise falls back to a find-ns eval, so it works against a vanilla nREPL server too. Returns nil when the namespace can't be determined.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-client.el
(defun cider-ns-loaded-p (&optional ns)
  "Return non-nil when NS is loaded in the connected runtime.
NS defaults to the current namespace.  Consults the track-state namespace
cache first - which is free, but only populated when cider-nrepl is present -
and otherwise falls back to a `find-ns' eval, so it works against a vanilla
nREPL server too.  Returns nil when the namespace can't be determined."
  (when-let* ((ns (or ns (cider-current-ns 'no-default)))
              (repl (cider-current-repl)))
    (or
     ;; Fast path: track-state already knows about this namespace.
     (and (nrepl-dict-get (cider-ns-load-cache repl) ns) t)
     ;; Fallback: ask the runtime directly (works without cider-nrepl).
     (equal "true"
            (nrepl-dict-get
             (cider-sync-tooling-eval (format "(some? (find-ns '%s))" ns) nil repl)
             "value")))))