Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
PizieDust committed Jan 6, 2024
1 parent 00125ff commit 71386ad
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,30 @@ of the value needs to be non-polymorphic to construct a meaningful value.
Tip (for VS Code OCaml Platform users): You can construct a value using a keybinding
<kbd>Alt</kbd>+<kbd>C</kbd> or on MacOS <kbd>Option</kbd>+<kbd>C</kbd>

#### Syntax Documentation

> since OCaml-LSP 1.18
OCaml-LSP can display documentation about the node under the cursor when the user hovers over some OCaml code. For example, hovering over the code snippet below will display some information about what the syntax is:

```ocaml
type point = {x: int; y: int}
```
Hovering over the above will display:
```
ocaml type point = { x : int; y : int }
syntax Record type: Allows you to define variants with a fixed set of fields, and all of the constructors for a record variant type must have the same fields. See Manual
```
The documentation is gotten from the Merlin engine which receives the nodes under the cursor and infers what the syntax may be about, and displays the required information along with links to the manual for further reading.

Syntax Documentation is an optional feature and you can activate it by using `ocaml.server.extraEnv` setting in VS Code if you use the VS Code OCaml Platform.
```json
"ocaml.server.extraEnv": {
"OCAMLLSP_ENABLE_SYNTAX_DOCUMENTATION": "true"
},
```
This option is also available via the GUI menu and is called `syntaxDocumentation` and can be enabled via the setting `{ enable: true }`.

## Debugging

If you use Visual Studio Code, please see OCaml Platform extension
Expand Down

0 comments on commit 71386ad

Please sign in to comment.