File tree Expand file tree Collapse file tree 3 files changed +38
-34
lines changed Expand file tree Collapse file tree 3 files changed +38
-34
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,12 @@ let hover ~path ~line ~col ~currentFile ~debug =
4343 ~for Hover:true
4444 in
4545 match completions with
46- | {kind = Label typString } :: _ ->
47- Protocol. stringifyHover (Hover. codeBlock typString)
46+ | {kind = Label typString ; docstring} :: _ ->
47+ let parts =
48+ (if typString = " " then [] else [Hover. codeBlock typString])
49+ @ docstring
50+ in
51+ Protocol. stringifyHover (String. concat " \n\n " parts)
4852 | _ -> (
4953 match CompletionBackEnd. completionsGetTypeEnv completions with
5054 | Some (typ , _env ) ->
Original file line number Diff line number Diff line change @@ -1403,39 +1403,39 @@ let processCompletable ~debug ~package ~scope ~env ~pos ~forHover
14031403 |> List. map mkLabel)
14041404 @ keyLabels
14051405 | Cdecorator prefix ->
1406- let mkDecorator (name , doc ) =
1407- Completion. create ~name ~kind: (Label doc ) ~env
1406+ let mkDecorator (name , docstring ) =
1407+ {( Completion. create ~name ~kind: (Label " " ) ~env ) with docstring}
14081408 in
14091409 [
1410- (" as" , " " );
1411- (" dead" , " ...docs for dead..." );
1412- (" deriving" , " " );
1413- (" genType" , " " );
1414- (" genType.as" , " " );
1415- (" genType.import" , " " );
1416- (" genType.opaque" , " " );
1417- (" get" , " " );
1418- (" get_index" , " " );
1419- (" inline" , " " );
1420- (" int" , " " );
1421- (" live" , " ...docs for live..." );
1422- (" meth" , " " );
1423- (" module" , " " );
1424- (" new" , " " );
1425- (" obj" , " " );
1426- (" react.component" , " " );
1427- (" return" , " " );
1428- (" scope" , " " );
1429- (" send" , " " );
1430- (" set" , " " );
1431- (" set_index" , " " );
1432- (" string" , " " );
1433- (" this" , " " );
1434- (" unboxed" , " " );
1435- (" uncurry" , " " );
1436- (" unwrap" , " " );
1437- (" val" , " " );
1438- (" variadic" , " " );
1410+ (" as" , [] );
1411+ (" dead" , [ " ...docs for dead..." ] );
1412+ (" deriving" , [] );
1413+ (" genType" , [] );
1414+ (" genType.as" , [] );
1415+ (" genType.import" , [] );
1416+ (" genType.opaque" , [] );
1417+ (" get" , [] );
1418+ (" get_index" , [] );
1419+ (" inline" , [] );
1420+ (" int" , [] );
1421+ (" live" , [ " ...docs for live..." ] );
1422+ (" meth" , [] );
1423+ (" module" , [] );
1424+ (" new" , [] );
1425+ (" obj" , [] );
1426+ (" react.component" , [] );
1427+ (" return" , [] );
1428+ (" scope" , [] );
1429+ (" send" , [] );
1430+ (" set" , [] );
1431+ (" set_index" , [] );
1432+ (" string" , [] );
1433+ (" this" , [] );
1434+ (" unboxed" , [] );
1435+ (" uncurry" , [] );
1436+ (" unwrap" , [] );
1437+ (" val" , [] );
1438+ (" variadic" , [] );
14391439 ]
14401440 |> List. filter (fun (decorator , _ ) -> Utils. startsWith decorator prefix)
14411441 |> List. map (fun (decorator , doc ) ->
Original file line number Diff line number Diff line change @@ -68,5 +68,5 @@ Hover tests/src/Hover.res 112:3
6868Nothing at that position. Now trying to use completion.
6969Attribute id:live:[112:0->112:5] label:live
7070Completable: Cdecorator(live)
71- {"contents": "```rescript\n ...docs for live...\n``` "}
71+ {"contents": "...docs for live..."}
7272
You can’t perform that action at this time.
0 commit comments