Skip to content

Commit e6a1a8c

Browse files
committed
[SourceKit] Document source.request.protocol_version
1 parent 4b0b325 commit e6a1a8c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tools/SourceKit/docs/Protocol.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,43 @@ Welcome to SourceKit. Type ':help' for assistance.
455455
}
456456
```
457457

458+
## Protocol Version
459+
460+
SourceKit can provide information about the version of the protocol that is being used.
461+
462+
### Request
463+
464+
```
465+
{
466+
<key.request>: (UID) <source.request.protocol_version>
467+
}
468+
```
469+
470+
### Response
471+
472+
```
473+
{
474+
<key.version_major>: (int64) // The major version number in a version string
475+
<key.version_minor>: (int64) // The minor version number in a version string
476+
}
477+
```
478+
479+
### Testing
480+
481+
```
482+
$ sourcekitd-test -req=version
483+
```
484+
485+
or
486+
487+
```
488+
$ sourcekitd-repl
489+
Welcome to SourceKit. Type ':help' for assistance.
490+
(SourceKit) {
491+
key.request: source.request.protocol_version
492+
}
493+
```
494+
458495
# UIDs
459496

460497
## Keys
@@ -472,3 +509,5 @@ Welcome to SourceKit. Type ':help' for assistance.
472509
- `key.sourcetext`
473510
- `key.typename`
474511
- `key.usr`
512+
- `key.version_major`
513+
- `key.version_minor`

0 commit comments

Comments
 (0)