Skip to content

Commit 5a9f4b4

Browse files
committed
Update the request documentation and the changelog entry.
1 parent 1724a87 commit 5a9f4b4

File tree

2 files changed

+32
-20
lines changed

2 files changed

+32
-20
lines changed

CHANGES.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
- Make MerlinJump code action configurable (#1376)
77

8-
- Add custom [`ocamllsp/merlinJump`](/ocaml-lsp-server/docs/ocamllsp/merlinJump-spec.md) request (#1374)
8+
- Add custom [`ocamllsp/jump`](/ocaml-lsp-server/docs/ocamllsp/merlinJump-spec.md) request (#1374)
99

1010
## Fixes
1111

@@ -20,7 +20,6 @@
2020

2121
- Add custom [`ocamllsp/getDocumentation`](/ocaml-lsp-server/docs/ocamllsp/getDocumentation-spec.md) request (#1336)
2222

23-
2423
- Add support for OCaml 5.2 (#1233)
2524

2625
- Add a code-action for syntactic and semantic movement shortcuts based on Merlin's Jump command (#1364)

ocaml-lsp-server/docs/ocamllsp/merlinJump-spec.md

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,49 @@ This custom request allows Merlin-type code navigation in a source buffer.
66

77
## Server capability
88

9-
- propert name: `handleMerlinJump`
9+
- propert name: `handleJump`
1010
- property type: `boolean`
1111

1212
## Request
1313

14+
- method: `ocamllsp/jump`
15+
- params: `JumpParams` extends [TextDocumentPositionParams](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentPositionParams) and is defined as follows:
16+
1417
```js
1518
export interface JumpParams extends TextDocumentPositionParams
1619
{
17-
target: string;
20+
/**
21+
* The requested target of the jump, one of `fun`, `let`, `module`,
22+
* `module-type`, `match`, `match-next-case`, `match-prev-case`.
23+
*
24+
* If omitted, all valid targets will be considered.
25+
*/
26+
target?: string;
1827
}
1928
```
2029

21-
- method: `ocamllsp/merlinJump`
22-
- params:
23-
- `TextDocument`: Specifies the document for which the request is sent. It includes a uri property that points to the document.
24-
- `Position`: Specifies the position in the document for which the documentation is requested. It includes line and character properties.
25-
More details can be found in the [Position - LSP Specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position) and [TextDocument](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentIdentifier)
26-
2730
## Response
2831

32+
- result: `Jump`
33+
2934
```js
30-
result: Some Jump list | None
31-
export interface Jump extends TextDocumentPositionParams {
35+
36+
export interface TargetPosition {
37+
/**
38+
* The target's kind.
39+
*/
40+
target: string;
41+
42+
/**
43+
* The corresponding position in the request's document.
44+
*/
45+
position: Position;
3246
}
33-
```
3447

35-
- result:
36-
- Type: Some Jump list or None
37-
- Description: All succesful jumps are accumulated in a list of (`target`,`position`) and returned or `None` indicating no valid targets.
38-
- Jump:
39-
- Type:
40-
- `Position`: The position to jump to.
41-
- `target`: The target which corresponds to this jump.
48+
export interface Jump {
49+
/**
50+
* The list of possible targets to jump-to.
51+
*/
52+
jumps: TargetPosition[]
53+
}
54+
```

0 commit comments

Comments
 (0)