Skip to content

Commit 88a772f

Browse files
committed
Show variant inline record type on hover
1 parent 6f799bc commit 88a772f

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

analysis/src/Hover.ml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,13 @@ let newHover ~full:{file; package} ~supportsMarkdownLinks locItem =
270270
| `Declared ->
271271
let typeString, docstring = t |> fromType ~docstring in
272272
typeString :: docstring
273-
| `Constructor {cname = {txt}; args; docstring} ->
274-
let typeString, docstring = t |> fromType ~docstring in
275-
let argsString =
276-
match args with
277-
| InlineRecord _ | Args [] -> ""
278-
| Args args ->
279-
args
280-
|> List.map (fun (t, _) -> Shared.typeToString t)
281-
|> String.concat ", " |> Printf.sprintf "(%s)"
273+
| `Constructor constructor ->
274+
let typeString, docstring =
275+
t |> fromType ~docstring:constructor.docstring
282276
in
283-
typeString :: Markdown.codeBlock (txt ^ argsString) :: docstring
277+
typeString
278+
:: Markdown.codeBlock (CompletionBackEnd.showConstructor constructor)
279+
:: docstring
284280
| `Field ->
285281
let typeString, docstring = t |> fromType ~docstring in
286282
typeString :: docstring)

0 commit comments

Comments
 (0)