Skip to content

Commit 9ba2bb6

Browse files
committed
Add padding between module docstring and type hover information
1 parent e45bd88 commit 9ba2bb6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

analysis/src/Hover.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ let showModuleTopLevel ~docstring ~isType ~name (topLevel : Module.item list) =
2626
let doc =
2727
match docstring with
2828
| [] -> ""
29-
| _ :: _ -> "\n" ^ (docstring |> String.concat "\n") ^ Markdown.divider
29+
| _ :: _ ->
30+
"\n"
31+
^ (docstring |> String.concat "\n")
32+
^ Markdown.divider ^ Markdown.spacing
3033
in
3134
Some (doc ^ full)
3235

tests/analysis_tests/tests/src/expected/Hover.res.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Hover src/Hover.res 6:7
88
{"contents": {"kind": "markdown", "value": "```rescript\nmodule Id: {\n type x = int\n}\n```"}}
99

1010
Hover src/Hover.res 19:11
11-
{"contents": {"kind": "markdown", "value": "\nThis module is commented\n---\n```rescript\nmodule Dep: {\n let customDouble: int => int\n}\n```"}}
11+
{"contents": {"kind": "markdown", "value": "\nThis module is commented\n---\n\n```\n \n```\n```rescript\nmodule Dep: {\n let customDouble: int => int\n}\n```"}}
1212

1313
Hover src/Hover.res 22:11
1414
{"contents": {"kind": "markdown", "value": "```rescript\nint => int\n```\n---\nSome doc comment"}}
@@ -343,7 +343,7 @@ Path x
343343
{"contents": {"kind": "markdown", "value": "```rescript\nbool\n```"}}
344344

345345
Hover src/Hover.res 278:8
346-
{"contents": {"kind": "markdown", "value": "\n [`Belt.Array`]()\n\n **mutable array**: Utilities functions\n\n---\n```rescript\nmodule Array: {\n module Id\n module Array\n module SortArray\n module MutableQueue\n module MutableStack\n module List\n module Range\n module Set\n module Map\n module MutableSet\n module MutableMap\n module HashSet\n module HashMap\n module Option\n module Result\n module Int\n module Float\n}\n```"}}
346+
{"contents": {"kind": "markdown", "value": "\n [`Belt.Array`]()\n\n **mutable array**: Utilities functions\n\n---\n\n```\n \n```\n```rescript\nmodule Array: {\n module Id\n module Array\n module SortArray\n module MutableQueue\n module MutableStack\n module List\n module Range\n module Set\n module Map\n module MutableSet\n module MutableMap\n module HashSet\n module HashMap\n module Option\n module Result\n module Int\n module Float\n}\n```"}}
347347

348348
Hover src/Hover.res 281:6
349349
{"contents": {"kind": "markdown", "value": "```rescript\ntype aliased = variant\n```\n\n---\n\n```\n \n```\n```rescript\ntype variant = CoolVariant | OtherCoolVariant\n```\nGo to: [Type definition](command:rescript-vscode.go_to_location?%5B%22Hover.res%22%2C251%2C0%5D)\n"}}

0 commit comments

Comments
 (0)