Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hover: use *** to print dividers. #1318

Merged
merged 3 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading