Skip to content

Commit 17705e3

Browse files
committed
update docs
1 parent 6e5d291 commit 17705e3

File tree

1 file changed

+23
-29
lines changed

1 file changed

+23
-29
lines changed

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

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,39 @@ This custom request allows clients to perform a type search at a specific positi
1111

1212
## Request
1313

14-
```js
15-
export interface TypeSearchParams extends TexDocumentPositionParams
14+
```json
1615
{
17-
query: string;
18-
limit: int;
19-
with_doc: bool;
16+
"text_document": TextDocumentIdentifier,
17+
"position": Position,
18+
"query": string,
19+
"limit": int,
20+
"with_doc": bool
2021
}
2122
```
2223
- method: `ocamllsp/typeSearch`
2324
- params:
24-
- `TextDocumentPositionParams`: This is an existing interface that includes:
25-
- `TextDocumentIdentifier`: Specifies the document uri for which the request is sent.
26-
- `Position`: Specifies the cursor position.
27-
More details can be found in the [TextDocumentPositionParams - LSP Specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentPositionParams).
25+
- `text_document`: Specifies the document uri for which the request is sent. More details can be found at [TextDocumentIdentifier - LSP Specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocumentIdentifier)
26+
- `Position`: Specifies the cursor position. More details can be found at [Position - LSP Specification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position).
2827
- `query`: The search pattern.
2928
- `limit`: The number of results to return
3029
- `with_doc`: If to return documentation information or not
3130

3231
## Response
3332

34-
```js
35-
result: TypeSearch | null
36-
export interface TypeSearch {
37-
type t = Query_protocol.type_search_result list
33+
```json
34+
{
35+
"name": string,
36+
"typ": string,
37+
"loc": Range,
38+
"doc": string,
39+
"cost": int,
40+
"constructible" : string
3841
}
39-
```
40-
- `t`: A list of types that match the query.
41-
```
42-
type Query_protocol.type_search_result =
43-
{
44-
"name": string; // The fully qualified name of this result.,
45-
"typ": string; // The signature of this result,
46-
"loc": { // The location of the definition of this result in the source code.
47-
"end": { "character": int, "line": int },
48-
"start": { "character": int, "line": int }
49-
},
50-
"doc": string // Optional documentation associated with this result.,
51-
"cost": int; // A numeric value representing the "cost" or distance between this result and the query.
52-
constructible : string; // A constructible form or template that can be used to invoke this result
53-
}
54-
```
42+
```
43+
- name: The fully qualified name of this result.,
44+
- typ: The signature of this result,
45+
- loc: The location of the definition of this result in the source code.,
46+
- doc: Optional documentation associated with this result.,
47+
- cost: A numeric value representing the "cost" or distance between this result and the query.
48+
- constructible: A constructible form or template that can be used to invoke this result
5549
- A response with null result is returned if no entries are found.

0 commit comments

Comments
 (0)