Supported nREPL operations
generated from a verbose 'describe' response (nREPL v1.1.0)
Operations
add-middleware
Adding some middleware
- Required parameters
-
-
:middlewarea list of middleware
-
- Optional parameters
-
-
:extra-namespacesa list of extra namespaces to load. This is useful when the new middleware feature deferred loading
-
- Returns
-
-
:statusdone, once done, anderror, if there’s any problems in loading a middleware -
:unresolved-middlewareList of middleware that could not be resolved
-
clone
Clones the current session, returning the ID of the newly-created session.
- Required parameters
- Optional parameters
-
-
:sessionThe ID of the session to be cloned; if not provided, a new session with default bindings is created, and mapped to the returned session ID.
-
- Returns
-
-
:new-sessionThe ID of the new session.
-
close
Closes the specified session.
- Required parameters
-
-
:sessionThe ID of the session to be closed.
-
- Optional parameters
- Returns
completions
Provides a list of completion candidates.
- Required parameters
-
-
:prefixThe prefix to complete.
-
- Optional parameters
-
-
:complete-fnThe fully qualified name of a completion function to use instead of the default one (e.g.my.ns/completion). -
:nsThe namespace in which we want to obtain completion candidates. Defaults to*ns*. -
:optionsA map of options supported by the completion function. Supported keys:extra-metadata(possible values::arglists,:docs).
-
- Returns
-
-
:completionsA list of completion candidates. Each candidate is a map with:candidateand:typekeys. Vars also have a:nskey.
-
describe
Produce a machine- and human-readable directory and documentation for the operations supported by an nREPL endpoint.
- Required parameters
- Optional parameters
-
-
:verbose?Include informational detail for each "op"eration in the return message.
-
- Returns
-
-
:auxMap of auxiliary data contributed by all of the active nREPL middleware via :describe-fn functions in their descriptors. -
:opsMap of "op"erations supported by this nREPL endpoint -
:versionsMap containing version maps (like *clojure-version*, e.g. major, minor, incremental, and qualifier keys) for values, component names as keys. Common keys include "nrepl" and "clojure".
-
eval
Evaluates code. Note that unlike regular stream-based Clojure REPLs, nREPL’s "eval" short-circuits on first read error and will not try to read and execute the remaining code in the message.
- Required parameters
-
-
:codeThe code to be evaluated. -
:sessionThe ID of the session within which to evaluate the code.
-
- Optional parameters
-
-
:columnThe column number in [file] at which [code] starts. -
:evalA fully-qualified symbol naming a var whose function value will be used to evaluate [code], instead ofclojure.core/eval(the default). -
:fileThe path to the file containing [code].clojure.core/*file*will be bound to this. -
:idAn opaque message ID that will be included in responses related to the evaluation, and which may be used to restrict the scope of a later "interrupt" operation. -
:lineThe line number in [file] at which [code] starts. -
:nsThe namespace in which to perform the evaluation. The supplied namespace must exist already (e.g. be loaded). If no namespace is specified the evaluation falls back to*ns*for the session in question. -
:read-condThe options passed to the reader before the evaluation. Useful when middleware in a higher layer wants to process reader conditionals. -
:nrepl.middleware.caught/caughtA fully-qualified symbol naming a var whose function to use to convey interactive errors. Must point to a function that takes ajava.lang.Throwableas its sole argument. -
:nrepl.middleware.caught/print?If logical true, the printed value of any interactive errors will be returned in the response (otherwise they will be elided). Delegates tonrepl.middleware.printto perform the printing. Defaults to false. -
:nrepl.middleware.print/buffer-sizeThe size of the buffer to use when streaming results. Defaults to 1024. -
:nrepl.middleware.print/keysA seq of the keys in the response whose values should be printed. -
:nrepl.middleware.print/optionsA map of options to pass to the printing function. Defaults tonil. -
:nrepl.middleware.print/printA fully-qualified symbol naming a var whose function to use for printing. Must point to a function with signature [value writer options]. -
:nrepl.middleware.print/quotaA hard limit on the number of bytes printed for each value. -
:nrepl.middleware.print/stream?If logical true, the result of printing each value will be streamed to the client over one or more messages.
-
- Returns
-
-
:exThe type of exception thrown, if any. If present, then:valuewill be absent. -
:ns*ns*, after successful evaluation ofcode. -
:root-exThe type of the root exception thrown, if any. If present, then:valuewill be absent. -
:valueThe result of evaluatingcode, oftenreadable. This printing is provided by theprintmiddleware. Superseded byexandroot-exif an exception occurs during evaluation.
-
interrupt
Attempts to interrupt some executing request. When interruption succeeds, the thread used for execution is killed, and a new thread spawned for the session. While the session middleware ensures that Clojure dynamic bindings are preserved, other ThreadLocals are not. Hence, when running code intimately tied to the current thread identity, it is best to avoid interruptions.
- Required parameters
-
-
:sessionThe ID of the session used to start the request to be interrupted.
-
- Optional parameters
-
-
:interrupt-idThe opaque message ID sent with the request to be interrupted.
-
- Returns
-
-
:status'interrupted' if a request was identified and interruption will be attempted 'session-idle' if the session is not currently executing any request 'interrupt-id-mismatch' if the session is currently executing a request sent using a different ID than specified by the "interrupt-id" value 'session-ephemeral' if the session is an ephemeral session
-
load-file
Loads a body of code, using supplied path and filename info to set source file and line number metadata. Delegates to underlying "eval" middleware/handler.
- Required parameters
-
-
:fileFull contents of a file of code.
-
- Optional parameters
-
-
:file-nameName of source file, e.g. io.clj -
:file-pathSource-path-relative path of the source file, e.g. clojure/java/io.clj -
:nrepl.middleware.caught/caughtA fully-qualified symbol naming a var whose function to use to convey interactive errors. Must point to a function that takes ajava.lang.Throwableas its sole argument. -
:nrepl.middleware.caught/print?If logical true, the printed value of any interactive errors will be returned in the response (otherwise they will be elided). Delegates tonrepl.middleware.printto perform the printing. Defaults to false. -
:nrepl.middleware.print/buffer-sizeThe size of the buffer to use when streaming results. Defaults to 1024. -
:nrepl.middleware.print/keysA seq of the keys in the response whose values should be printed. -
:nrepl.middleware.print/optionsA map of options to pass to the printing function. Defaults tonil. -
:nrepl.middleware.print/printA fully-qualified symbol naming a var whose function to use for printing. Must point to a function with signature [value writer options]. -
:nrepl.middleware.print/quotaA hard limit on the number of bytes printed for each value. -
:nrepl.middleware.print/stream?If logical true, the result of printing each value will be streamed to the client over one or more messages.
-
- Returns
-
-
:exThe type of exception thrown, if any. If present, then:valuewill be absent. -
:root-exThe type of the root exception thrown, if any. If present, then:valuewill be absent. -
:valueThe result of evaluatingcode, oftenreadable. This printing is provided by theprintmiddleware. Superseded byexandroot-exif an exception occurs during evaluation.
-
lookup
Lookup symbol info.
- Required parameters
-
-
:symThe symbol to lookup.
-
- Optional parameters
-
-
:lookup-fnThe fully qualified name of a lookup function to use instead of the default one (e.g.my.ns/lookup). -
:nsThe namespace in which we want to do lookup. Defaults to*ns*.
-
- Returns
-
-
:infoA map of the symbol’s info.
-
ls-middleware
List of current middleware
- Required parameters
- Optional parameters
- Returns
-
-
:middlewarelist of vars representing loaded middleware, from inside out
-
ls-sessions
Lists the IDs of all active sessions.
- Required parameters
- Optional parameters
- Returns
-
-
:sessionsA list of all available session IDs.
-
sideloader-provide
Provides a requested class or resource.
- Required parameters
-
-
:contentbase64 string -
:namethe class or resource name -
:sessionthe id of the session -
:type"class" or "resource"
-
- Optional parameters
- Returns
sideloader-start
Starts a sideloading session.
- Required parameters
-
-
:sessionthe id of the session
-
- Optional parameters
- Returns
-
-
:status"sideloader-lookup", never ever returns "done".
-
stdin
Add content from the value of "stdin" to *in* in the current session.
- Required parameters
-
-
:stdinContent to add to *in*.
-
- Optional parameters
- Returns
-
-
:statusA status of "need-input" will be sent if a session’s *in* requires content in order to satisfy an attempted read operation.
-
swap-middleware
Replace the whole middleware stack
- Required parameters
-
-
:middlewarea list of middleware
-
- Optional parameters
-
-
:extra-namespacesa list of extra namespaces to load. This is useful when the new middleware feature deferred loading
-
- Returns
-
-
:statusdone, once done, anderror, if there’s any problems in loading a middleware -
:unresolved-middlewareList of middleware that could not be resolved
-