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
[SourceKit] Add optional declarations array to interface gen request (#75802)
Introduces the new DeclarationsArrayBuilder and adds it to the
EditorConsumer. Declaration info always includes a kind, offset, and
length, and includes a USR where applicable.
As the USR is already available for editor.open.interface type requests,
this doesn't compute any new information, it just exposes more of what's
there already.
Copy file name to clipboardExpand all lines: tools/SourceKit/docs/Protocol.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -362,16 +362,19 @@ Welcome to SourceKit. Type ':help' for assistance.
362
362
<key.modulename>: (string) // Full module name, e.g. "Foundation.NSArray"
363
363
[opt] <key.compilerargs> [string*] // array of zero or more strings for the compiler arguments
364
364
// e.g ["-sdk", "/path/to/sdk"]
365
+
[opt] <key.enabledeclarations> (int) // 0 by default, 1 to enable the declarations array in the output
365
366
}
366
367
```
367
368
368
369
### Response
369
370
370
371
This will return the Swift interface of the specified module.
371
372
372
-
-`key.sourcetext`: The pretty-printed module interface in swift source code
373
+
-`key.sourcetext`: The pretty-printed module interface in swift source code.
373
374
-`key.syntaxmap`: An array of syntactic annotations, same as the one returned for the source.request.editor.open request.
374
375
-`key.annotations`: An array of semantic annotations, same as the one returned for the source.request.editor.open request.
376
+
-`key.substructure`: An array of dictionaries representing ranges of structural elements in the result description, such as the parameters of a function.
377
+
- (optional, only if `key.enabledeclarations: 1`) `key.declarations`: An array of declarations, containing the kind, USR (if available), offset, and length of the declaration.
375
378
376
379
All SourceKit requests that don't modify the source buffer should work on the
377
380
opened document, by passing the associated 'name' for the document.
0 commit comments