File: ops.md

package info (click to toggle)
tools-nrepl-clojure 0.2.13-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 388 kB
  • sloc: xml: 328; java: 158; makefile: 38
file content (167 lines) | stat: -rw-r--r-- 4,737 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!-- This file is *generated* by #'clojure.tools.nrepl.describe-test/update-op-docs
   **Do not edit!** -->
# Supported nREPL operations

<small>generated from a verbose 'describe' response (nREPL v0.2.11-SNAPSHOT)</small>

## Operations

### `:clone`

Clones the current session, returning the ID of the newly-created session.

###### Required parameters



###### Optional parameters

* `:session` The 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-session` The ID of the new session.


### `:close`

Closes the specified session.

###### Required parameters

* `:session` The ID of the session to be closed.


###### Optional parameters



###### Returns



### `: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

* `:aux` Map of auxilliary data contributed by all of the active nREPL middleware via :describe-fn functions in their descriptors.
* `:ops` Map of "op"erations supported by this nREPL endpoint
* `:versions` Map 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.

###### Required parameters

* `:code` The code to be evaluated.
* `:session` The ID of the session within which to evaluate the code.


###### Optional parameters

* `:column` The column number in [file] at which [code] starts.
* `:eval` A fully-qualified symbol naming a var whose function value will be used to evaluate [code], instead of `clojure.core/eval` (the default).
* `:file` The path to the file containing [code]. `clojure.core/\*file\*` will be bound to this.
* `:id` An 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.
* `:line` The line number in [file] at which [code] starts.


###### Returns

* `:ex` The type of exception thrown, if any. If present, then `values` will be absent.
* `:ns` \*ns\*, after successful evaluation of `code`.
* `:root-ex` The type of the root exception thrown, if any. If present, then `values` will be absent.
* `:values` The result of evaluating `code`, often `read`able. This printing is provided by the `pr-values` middleware, and could theoretically be customized. Superseded by `ex` and `root-ex` if an exception occurs during evaluation.


### `:interrupt`

Attempts to interrupt some code evaluation.

###### Required parameters

* `:session` The ID of the session used to start the evaluation to be interrupted.


###### Optional parameters

* `:interrupt-id` The opaque message ID sent with the original "eval" request.


###### Returns

* `:status` 'interrupted' if an evaluation was identified and interruption will be attempted
'session-idle' if the session is not currently evaluating any code
'interrupt-id-mismatch' if the session is currently evaluating code sent using a different ID than specified by the "interrupt-id" value 


### `: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

* `:file` Full contents of a file of code.


###### Optional parameters

* `:file-name` Name of source file, e.g. io.clj
* `:file-path` Source-path-relative path of the source file, e.g. clojure/java/io.clj


###### Returns

* `:ex` The type of exception thrown, if any. If present, then `values` will be absent.
* `:ns` \*ns\*, after successful evaluation of `code`.
* `:root-ex` The type of the root exception thrown, if any. If present, then `values` will be absent.
* `:values` The result of evaluating `code`, often `read`able. This printing is provided by the `pr-values` middleware, and could theoretically be customized. Superseded by `ex` and `root-ex` if an exception occurs during evaluation.


### `:ls-sessions`

Lists the IDs of all active sessions.

###### Required parameters



###### Optional parameters



###### Returns

* `:sessions` A list of all available session IDs.


### `:stdin`

Add content from the value of "stdin" to \*in\* in the current session.

###### Required parameters

* `:stdin` Content to add to \*in\*.


###### Optional parameters



###### Returns

* `:status` A status of "need-input" will be sent if a session's \*in\* requires content in order to satisfy an attempted read operation.