Skip to content

Commit a1d77ee

Browse files
committed
[SourceKit] Added completion.open-result docs
1 parent 4eced39 commit a1d77ee

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tools/SourceKit/docs/Protocol.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,24 @@ completion-result ::=
7979
}
8080
```
8181

82+
```
83+
completion.open-result ::=
84+
{
85+
<key.kind>: (UID) // UID for the declaration kind (function, class, etc.).
86+
<key.name>: (string) // Name of the word being completed
87+
<key.sourcetext>: (string) // Text to be inserted in source.
88+
<key.description>: (string) // Text to be displayed in code-completion window.
89+
<key.typename>: (string) // Text describing the type of the result.
90+
<key.context>: (UID) // Semantic context of the code completion result.
91+
<key.num_bytes_to_erase>: (int64) // Number of bytes to the left of the cursor that should be erased before inserting this completion result.
92+
<key.substructure>: (dictionary) // Can contains an array the `nameoffset`, `namelength`, `bodyoffset`, `bodylength`, and `substructure`. Other `substructure` will exist if the code complete represents a function. Each one is a paramater of the function
93+
- <key.nameoffset> (int64) // The offset location of the given parameter
94+
- <key.namelength> (int64) // The length of the given parameter
95+
- <key.bodyoffset> (int64) // The `nameoffset` + the indentation inside the body of the file
96+
- <key.bodylength> (int64) // The `namelength` + the indentation inside the body of the file
97+
}
98+
```
99+
82100
### Testing
83101

84102
```

0 commit comments

Comments
 (0)