Provides a simple way to setup the CIDER nREPL middleware in Leiningen projects.
Provides a simple way to setup the CIDER nREPL middleware in Leiningen projects.
Middleware descriptors and related utility functions.
While normally middleware descriptors live alongside middleware definitions, cider-nrepl separates those. The rationale behind this is to avoid loading each middleware definition until its first usage. For this purpose we're defining each middleware as a wrapper that defers the loading of the actual middleware.
Middleware descriptors and related utility functions. While normally middleware descriptors live alongside middleware definitions, cider-nrepl separates those. The rationale behind this is to avoid loading each middleware definition until its first usage. For this purpose we're defining each middleware as a wrapper that defers the loading of the actual middleware.
This namespace mostly exists, so that it's easy to share the list of provided middleware.
Eventually the deferred middleware loading code will be probably moved here as well.
This namespace mostly exists, so that it's easy to share the list of provided middleware. Eventually the deferred middleware loading code will be probably moved here as well.
Search symbols and docs matching a regular expression
Search symbols and docs matching a regular expression
This middleware allows you to query for data ClojureDocs.
It's a very simple wrapper around orchard.clojuredocs.
This middleware allows you to query for data ClojureDocs. It's a very simple wrapper around `orchard.clojuredocs`.
Code completion middleware. Delegates to the compliment library for the heavy lifting. Uses clj-suitable for ClojureScript completion.
Code completion middleware. Delegates to the compliment library for the heavy lifting. Uses clj-suitable for ClojureScript completion.
Rich content handling for CIDER. Mostly derived from the pprint middleware.
In the long ago, @technomancy [1] talked about his vision for using nREPL to support multimedia results beyond plain text, ala DrRacket and other "rich" REPLs. There was an initial cut at this [2], which never became part of the mainline Emacs tooling.
The goal of this module is to provide some support for recognizing multimedia objects (images and URIs thereto) as the result of evaluation, so that they can be rendered by a REPL.
The design of this module is based heavily on RFC-2045 [3] which
describes messages packaged with Content-Type,
Content-Transfer-Encoding and of course a body in that it seeks to
provide decorated responses which contain metadata which a client
can use to provide a rich interpretation.
There's also RFC-2017 [4] which defines the message/external-body
MIME type for defining messages which don't contain their own
bodies.
The basic architecture of this changeset is that eval results are inspected, and matched against two fundamental supported cases. One is that the value is actually a binary Java image, which can be MIME encoded and transmitted back directly. The other is that the object is some variant of a URI (such as a file naming an image or other content) which cannot be directly serialized. In this second case we send an RFC-2017 response which provides the URL from which a client could request the nREPL server slurp the desired content.
Hence the slurp middleware which slurps URLs and produces MIME coded data.
[1] https://groups.google.com/forum/#!topic/clojure-tools/rkmJ-5086RY [2] https://github.com/technomancy/nrepl-discover/blob/master/src/nrepl/discover/samples.clj#L135 [3] https://tools.ietf.org/html/rfc2045 [4] https://tools.ietf.org/html/rfc2017
Rich content handling for CIDER. Mostly derived from the pprint middleware. --- In the long ago, @technomancy [1] talked about his vision for using nREPL to support multimedia results beyond plain text, ala DrRacket and other "rich" REPLs. There was an initial cut at this [2], which never became part of the mainline Emacs tooling. The goal of this module is to provide some support for recognizing multimedia objects (images and URIs thereto) as the result of evaluation, so that they can be rendered by a REPL. The design of this module is based heavily on RFC-2045 [3] which describes messages packaged with `Content-Type`, `Content-Transfer-Encoding` and of course a body in that it seeks to provide decorated responses which contain metadata which a client can use to provide a rich interpretation. There's also RFC-2017 [4] which defines the `message/external-body` MIME type for defining messages which don't contain their own bodies. The basic architecture of this changeset is that eval results are inspected, and matched against two fundamental supported cases. One is that the value is actually a binary Java image, which can be MIME encoded and transmitted back directly. The other is that the object is some variant of a URI (such as a file naming an image or other content) which cannot be directly serialized. In this second case we send an RFC-2017 response which provides the URL from which a client could request the nREPL server slurp the desired content. Hence the slurp middleware which slurps URLs and produces MIME coded data. --- [1] https://groups.google.com/forum/#!topic/clojure-tools/rkmJ-5086RY [2] https://github.com/technomancy/nrepl-discover/blob/master/src/nrepl/discover/samples.clj#L135 [3] https://tools.ietf.org/html/rfc2045 [4] https://tools.ietf.org/html/rfc2017
Expression-based debugger for clojure code
Expression-based debugger for clojure code
Instrument user code to "light up" when it runs. The instrumented code will report the value of local variables and report its return value. Implemented as an extension of the debugger.
Instrument user code to "light up" when it runs. The instrumented code will report the value of local variables and report its return value. Implemented as an extension of the debugger.
Code and EDN formatting functionality.
Code and EDN formatting functionality.
Capture, debug, inspect and view log events emitted by Java logging frameworks.
Capture, debug, inspect and view log events emitted by Java logging frameworks.
Macroexpansion middleware.
Macroexpansion middleware.
Change out, err, System/out and System/err to print on sessions in addition to process out.
Automatically changes the root binding of all output channels to print to any active sessions. An active session is one that has sent at least one "eval" op.
We use an eval message, instead of the clone op, because there's no guarantee that the channel that sent the clone message will properly handle output replies.
Change *out*, *err*, System/out and System/err to print on sessions in addition to process out. Automatically changes the root binding of all output channels to print to any active sessions. An active session is one that has sent at least one "eval" op. We use an eval message, instead of the clone op, because there's no guarantee that the channel that sent the clone message will properly handle output replies.
Simplistic manual tracing profiler for coarse usecases where the accuracy doesn't matter much and you already know which functions to measure.
Simplistic manual tracing profiler for coarse usecases where the accuracy doesn't matter much and you already know which functions to measure.
Reload changed namespaces. Alternative to cider.nrepl.middleware.refresh, using clj-reload instead of tools.namespace.
Reload changed namespaces. Alternative to cider.nrepl.middleware.refresh, using clj-reload instead of tools.namespace.
Rich reading & handling for CIDER.
Goes with middleware.content-types, providing the capability to convert URLs to values which can be handled nicely.
Rich reading & handling for CIDER. Goes with middleware.content-types, providing the capability to convert URLs to values which can be handled nicely.
Cause and stacktrace analysis for exceptions
Cause and stacktrace analysis for exceptions
Stream values sent to `tap>' to the client, and let it inspect them.
A subscription registers an add-tap' handler that, for each tapped value, retains it (bounded, for later inspection) and forwards a short summary to the client on the subscribing request - mirroring how the trace middleware streams events.cider/tap-inspect' starts a normal inspector session on a retained
value by its index, so the client reuses the existing inspector UI.
Stream values sent to `tap>' to the client, and let it inspect them. A subscription registers an `add-tap' handler that, for each tapped value, retains it (bounded, for later inspection) and forwards a short summary to the client on the subscribing request - mirroring how the trace middleware streams events. `cider/tap-inspect' starts a normal inspector session on a retained value by its index, so the client reuses the existing inspector UI.
ClojureScript support for the tap middleware.
The JVM add-tap' can't seetap>' in a JS runtime, so for a ClojureScript
REPL we load a runtime helper (cider.nrepl.cljs.tap') that buffers tapped values, and poll it viaeval' - the same approach the cljs test middleware
uses to await async tests.
Streaming only: a tapped ClojureScript value lives in the JS runtime, so it can't be handed to the JVM inspector. So cljs tap entries carry no `idx' and aren't inspectable (a later phase could inspect them in the runtime).
ClojureScript support for the tap middleware. The JVM `add-tap' can't see `tap>' in a JS runtime, so for a ClojureScript REPL we load a runtime helper (`cider.nrepl.cljs.tap') that buffers tapped values, and poll it via `eval' - the same approach the cljs test middleware uses to await async tests. Streaming only: a tapped ClojureScript value lives in the JS runtime, so it can't be handed to the JVM inspector. So cljs tap entries carry no `idx' and aren't inspectable (a later phase could inspect them in the runtime).
Test execution, reporting, and inspection
Test execution, reporting, and inspection
ClojureScript support for the test middleware.
ClojureScript tests can only run in the JS runtime, and eval is the only way
to reach it. So, much like the Clojure path drives execution through eval for
interruptibility, here we rewrite the test op into an eval op that runs the
tests via cljs.test in the runtime, capturing each assertion as EDN-safe data
(see cider.nrepl.cljs.test), then reshape that data into the very same report
the Clojure path produces. See clojure-emacs/cider#555.
Asynchronous (cljs.test/async) tests are awaited by polling the runtime for
the :end-run-tests event (a single eval can't block the JS event loop), up to
an optional :timeout. Other limitations: fail-fast is ignored (cljs.test
has no equivalent); running specific vars runs (but only reports) their whole
namespace, since fixtures are namespace-scoped; and concurrent test runs
sharing one ClojureScript runtime aren't isolated (the reporter state and the
JVM-side results store are global).
ClojureScript support for the test middleware. ClojureScript tests can only run in the JS runtime, and `eval` is the only way to reach it. So, much like the Clojure path drives execution through `eval` for interruptibility, here we rewrite the test op into an `eval` op that runs the tests via `cljs.test` in the runtime, capturing each assertion as EDN-safe data (see `cider.nrepl.cljs.test`), then reshape that data into the very same report the Clojure path produces. See clojure-emacs/cider#555. Asynchronous (`cljs.test/async`) tests are awaited by polling the runtime for the `:end-run-tests` event (a single eval can't block the JS event loop), up to an optional `:timeout`. Other limitations: `fail-fast` is ignored (`cljs.test` has no equivalent); running specific vars runs (but only reports) their whole namespace, since fixtures are namespace-scoped; and concurrent test runs sharing one ClojureScript runtime aren't isolated (the reporter state and the JVM-side results store are global).
Extensions to clojure.test functionality.
These are kept in a separate namespace because they are, by definition, opinionated.
Extensions to `clojure.test` functionality. These are kept in a separate namespace because they are, by definition, opinionated.
State tracker for client sessions.
State tracker for client sessions.
Middleware for undefining symbols. Fully qualified symbols are interpreted as a var to be unmapped in its original namespace, whereas unqualified symbols are interpreted as both a var and ns alias to be unmapped from the current namespace.
Middleware for undefining symbols. Fully qualified symbols are interpreted as a var to be unmapped in its original namespace, whereas unqualified symbols are interpreted as both a var and ns alias to be unmapped from the current namespace.
Utility functions that might be useful in middleware.
Utility functions that might be useful in middleware.
Coercion utilities for coercing bencoded maps.
Coercion utilities for coercing bencoded maps.
Utilities to safely reply to op requests and help deal with the errors/exceptions that might arise from doing so.
Utilities to safely reply to op requests and help deal with the errors/exceptions that might arise from doing so.
Generic instrumentation for clojure code
Generic instrumentation for clojure code
Utility functions for extracting and manipulating metadata.
Utility functions for extracting and manipulating metadata.
Common nREPL-related utilities.
Common nREPL-related utilities.
Common parts for the code-reloading middleware namespaces.
Common parts for the code-reloading middleware namespaces.
Return version info of the CIDER-nREPL middleware itself.
Return version info of the CIDER-nREPL middleware itself.
Find function dependencies and function references.
Find function dependencies and function references.
Pretty-print related utilities. All functions here are simple wrappers compatible with the expectations of nrepl.middleware.print/wrap-print.
Pretty-print related utilities. All functions here are simple wrappers compatible with the expectations of nrepl.middleware.print/wrap-print.
Extending print-method defined in clojure.core, to provide
prettier versions of some objects. This applies to anything that
calls print-method, which includes return values, pr, print
and the likes.
Extending `print-method` defined in clojure.core, to provide prettier versions of some objects. This applies to anything that calls `print-method`, which includes return values, `pr`, `print` and the likes.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |