Skip to content

Commit 600016e

Browse files
committed
hover: remove spacing between type definition
1 parent ee7a83a commit 600016e

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
1313
## master
1414

15+
#### :nail_care: Polish
16+
- Remove spacing between type definition in clients that do not support markdown links. https://github.com/rescript-lang/rescript-vscode/pull/619
17+
1518
#### :bug: Bug Fix
1619

1720
- Fix issue where `-open Some.Path` in `"bsc-flags"` would sometimes be treated differently from `open Some.Path` locally in a file https://github.com/rescript-lang/rescript-vscode/pull/616

Diff for: analysis/src/Hover.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ let hoverWithExpandedTypes ~docstring ~file ~package ~supportsMarkdownLinks typ
100100
Markdown.goToDefinitionText ~env ~pos:loc.Warnings.loc_start
101101
else ""
102102
in
103-
"\n" ^ Markdown.spacing
103+
Markdown.divider ^ (if supportsMarkdownLinks then Markdown.spacing else "")
104104
^ Markdown.codeBlock
105105
(decl
106106
|> Shared.declToString ~printNameAsIs:true
107107
(SharedTypes.pathIdentToString path))
108-
^ linkToTypeDefinitionStr ^ "\n" ^ Markdown.divider)
108+
^ linkToTypeDefinitionStr ^ "\n")
109109
in
110110
(typeString :: typeDefinitions |> String.concat "\n", docstring)
111111

Diff for: analysis/src/Protocol.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ let stringifyCompletionItem c =
9797
| None -> null
9898
| Some doc -> stringifyMarkupContent doc)
9999

100-
let stringifyHover s = Printf.sprintf {|{"contents": "%s"}|} (Json.escape s)
100+
let stringifyHover value = Printf.sprintf {|{"contents": %s}|} (stringifyMarkupContent {kind = "markdown"; value})
101101

102102
let stringifyLocation (h : location) =
103103
Printf.sprintf {|{"uri": "%s", "range": %s}|} (Json.escape h.uri)

0 commit comments

Comments
 (0)