You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[opt] <key.sourcefile>: (string) // Absolute path to the file.
202
+
[opt] <key.compilerargs> [string*] // Array of zero or more strings for the compiler arguments
203
+
// e.g ["-sdk", "/path/to/sdk"]. If key.sourcefile is provided,
204
+
// these must include the path to that file.
190
205
}
191
206
```
192
207
193
-
This will return:
208
+
### Response
194
209
195
-
-`key.sourcetext`: The pretty-printed module interface in swift source code
196
-
-`key.annotations`: An array of annotations for the tokens of source text, they refer to the text via offset+length entries. This includes syntactic annotations (e.g. keywords) and semantic ones. The semantic ones include the name and USR of the referenced symbol.
197
-
-`key.entities`: A structure of the symbols, similar to what the indexing request returns (a class has its methods as sub-entities, etc.). This includes the function parameters and their types as entities. Each entity refers to the range of the original text via offset+length entries.
210
+
```
211
+
{
212
+
<key.sourcetext>: (string) // Source contents.
213
+
<key.annotations>: (array) [annotation*] // An array of annotations for the tokens of
214
+
// source text, they refer to the text via offset + length
215
+
// entries. This includes syntactic annotations (e.g.
216
+
// keywords) and semantic ones. The semantic ones include
217
+
// the name and USR of the referenced symbol.
218
+
[opt] <key.entities>: (array) [entity*] // A structure of the symbols, similar to what the indexing
219
+
// request returns (a class has its methods as sub-entities,
220
+
// etc.). This includes the function parameters and their
221
+
// types as entities. Each entity refers to the range of the
222
+
// original text via offset + length entries.
223
+
[opt] <key.diagnostics>: (array) [diagnostic*] // Compiler diagnostics emitted during parsing of a source file.
224
+
// This key is only present if a diagnostic was emitted (and thus
225
+
// the length of the array is non-zero).
226
+
}
227
+
```
198
228
229
+
```
230
+
annotation ::=
231
+
{
232
+
<key.kind>: (UID) // UID for the declaration kind (function, class, etc.).
233
+
<key.offset>: (int64) // Location of the annotated token.
234
+
<key.length>: (int64) // Length of the annotated token.
235
+
}
236
+
```
199
237
200
-
For source text (you can also pass a source filename with `key.sourcefile`):
238
+
```
239
+
entity ::=
240
+
{
241
+
<key.kind>: (UID) // UID for the declaration or reference kind (function, class, etc.).
242
+
<key.name>: (string) // Displayed name for the entity.
243
+
<key.usr>: (string) // USR string for the entity.
244
+
<key.offset>: (int64) // Location of the entity.
245
+
<key.length>: (int64) // Length of the entity.
246
+
<key.fully_annotated_decl>: (string) // XML representing the entity, its USR, etc.
247
+
[opt] <key.doc.full_as_xml>: (string) // XML representing the entity and its documentation. Only present
248
+
// when the entity is documented.
249
+
[opt] <key.entities>: (array) [entity+] // One or more entities contained in the particular entity (sub-classes, references, etc.).
250
+
}
251
+
```
201
252
202
253
```
254
+
diagnostic ::=
203
255
{
204
-
"key.request": source.request.docinfo,
205
-
"key.sourcefile": "/whatever/virtual/path",
206
-
"key.sourcetext": "import Foundation\n var s: NSString\n",
0 commit comments