Skip to content

Commit

Permalink
hover: use *** to print dividers. (#1318)
Browse files Browse the repository at this point in the history
* hover: use `***` to print dividers.

vscode renderer treats the section before a `---` divider as a title.
  • Loading branch information
voodoos committed Jun 21, 2024
1 parent d41d8dd commit 68fbc55
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
- Disable automatic completion and signature help inside comments (#1246)

- Includes a new optional/configurable option to toggle syntax documentation. If
toggled on, allows display of sytax documentation on hover tooltips. Can be
toggled on, allows display of syntax documentation on hover tooltips. Can be
controlled via environment variables and by GUI for VS code. (#1218)

- For completions on labels that the LSP gets from merlin, take into account
Expand All @@ -69,6 +69,8 @@

- Fix parenthesizing of function types in `SignatureHelp` (#1296)

- Fix syntax documentation rendering (#1318)

# 1.17.0

## Fixes
Expand Down
2 changes: 1 addition & 1 deletion ocaml-lsp-server/src/hover_req.ml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ let hover_at_cursor parsetree (`Logical (cursor_line, cursor_col)) =
in
!result

let print_dividers sections = String.concat ~sep:"\n---\n" sections
let print_dividers sections = String.concat ~sep:"\n***\n" sections

let format_as_code_block ~highlighter strings =
sprintf "```%s\n%s\n```" highlighter (String.concat ~sep:" " strings)
Expand Down
4 changes: 2 additions & 2 deletions ocaml-lsp-server/test/e2e-new/syntax_doc_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type color = Red|Blue
{
"contents": {
"kind": "plaintext",
"value": "type color = Red | Blue\n---\n`syntax` Variant Type: Represent's data that may take on multiple different forms.. See [Manual](https://v2.ocaml.org/releases/4.14/htmlman/typedecl.html#ss:typedefs)"
"value": "type color = Red | Blue\n***\n`syntax` Variant Type: Represent's data that may take on multiple different forms.. See [Manual](https://v2.ocaml.org/releases/4.14/htmlman/typedecl.html#ss:typedefs)"
},
"range": {
"end": { "character": 21, "line": 1 },
Expand Down Expand Up @@ -129,7 +129,7 @@ type t = ..
{
"contents": {
"kind": "plaintext",
"value": "type t = ..\n---\n`syntax` Extensible Variant Type: Can be extended with new variant constructors using `+=`.. See [Manual](https://v2.ocaml.org/releases/4.14/htmlman/extensiblevariants.html)"
"value": "type t = ..\n***\n`syntax` Extensible Variant Type: Can be extended with new variant constructors using `+=`.. See [Manual](https://v2.ocaml.org/releases/4.14/htmlman/extensiblevariants.html)"
},
"range": {
"end": { "character": 11, "line": 1 },
Expand Down
4 changes: 2 additions & 2 deletions ocaml-lsp-server/test/e2e/__tests__/ocamllsp-hoverExtended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Object {
"value": "\`\`\`ocaml
'a -> 'a
\`\`\`
---
***
This function has a nice documentation",
},
"range": Object {
Expand Down Expand Up @@ -211,7 +211,7 @@ Object {
"value": "\`\`\`ocaml
int -> int -> int
\`\`\`
---
***
This function has a nice documentation.
It performs division of two integer numbers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Object {
"value": "\`\`\`ocaml
'a -> 'a
\`\`\`
---
***
This function has a nice documentation",
},
"range": Object {
Expand Down Expand Up @@ -188,7 +188,7 @@ Object {
"value": "\`\`\`ocaml
'a -> 'a
\`\`\`
---
***
This function has a nice documentation",
},
"range": Object {
Expand Down Expand Up @@ -263,7 +263,7 @@ Object {
"value": "\`\`\`ocaml
int -> int -> int
\`\`\`
---
***
This function has a nice documentation.
It performs division of two integer numbers.
Expand Down

0 comments on commit 68fbc55

Please sign in to comment.