Skip to content

Commit b2debd6

Browse files
committed
Add specification
1 parent 8357e96 commit b2debd6

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Jump To Typed Holes Requet
2+
3+
### Description
4+
5+
Provides control over navigation between the different types of holes
6+
present in a document (allowing you to return the position of the next
7+
or previous hole) and to observe holes in ranges.
8+
9+
10+
### Why this custom request needed
11+
12+
Reduces the need for editor-side logic and works well with the
13+
expression construct command. For example, constructing a value of
14+
type `int option` constructs, for example, the following expression:
15+
`Some _`, coupled with typed hole navigation, you can move the cursor
16+
directly over the generated hole.
17+
18+
19+
### A note on stability:
20+
21+
> OCaml-LSP does not guarantee stability for this custom request,
22+
> meaning the core contributors may change or remove this custom
23+
> request, as they see necessary.
24+
25+
## Client capability
26+
27+
nothing that should be noted
28+
29+
## Server capability
30+
31+
- property name: `handleJumpTypedHole`
32+
- property type: `boolean`
33+
34+
## Request
35+
36+
- method: `ocamllsp/jumpTypedHole`
37+
- params:
38+
39+
```json
40+
{
41+
"uri": TextDocumentIdentifier,
42+
"position": Position,
43+
"direction": <"next"|"prev">,
44+
"range?": Range
45+
}
46+
```
47+
48+
If a `range` is given, it will only select holes present in the given
49+
range.
50+
51+
## Response
52+
53+
```json
54+
Range | null
55+
```
56+
57+
Returns the next or previous hole, or `null` if no hole has been
58+
found.

0 commit comments

Comments
 (0)