Skip to content

Commit ea13b51

Browse files
committed
Sync outcome printer from syntax repo.
1 parent 4786221 commit ea13b51

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ Completable: Cdecorator(live)
7171
{"contents": "The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.\n\n`@live` tells the dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values. It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#live-decorator).\n\nHint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!"}
7272

7373
Hover tests/src/Hover.res 115:4
74-
{"contents": "```rescript\n(. unit) => int\n```"}
74+
{"contents": "```rescript\n(.) => unit => int\n```"}
7575

7676
Hover tests/src/Hover.res 121:4
77-
{"contents": "```rescript\nJs.Fn.arity0<(. ()) => int>\n```"}
77+
{"contents": "```rescript\n(.) => (.) => int\n```"}
7878

7979
Hover tests/src/Hover.res 124:4
80-
{"contents": "```rescript\nJs.Fn.arity0<Js.Fn.arity0<array<int>>>\n```"}
80+
{"contents": "```rescript\n(.) => (.) => array<int>\n```"}
8181

analysis/vendor/res_outcome_printer/res_outcome_printer.ml

+6-8
Original file line numberDiff line numberDiff line change
@@ -233,20 +233,18 @@ let printPolyVarIdent txt =
233233
)
234234
| Otyp_alias (typ, aliasTxt) ->
235235
Doc.concat [
236-
Doc.lparen;
237236
printOutTypeDoc typ;
238237
Doc.text " as '";
239-
Doc.text aliasTxt;
240-
Doc.rparen
238+
Doc.text aliasTxt
241239
]
242240
| Otyp_constr (
243241
Oide_dot (Oide_dot (Oide_ident "Js", "Fn") , "arity0"), (* Js.Fn.arity0 *)
244-
[Otyp_constr (Oide_ident ident, [])] (* int or unit or string *)
242+
[typ]
245243
) ->
246-
(* Js.Fn.arity0<int> -> (.) => int*)
244+
(* Js.Fn.arity0<t> -> (.) => t *)
247245
Doc.concat [
248-
Doc.text "(. ()) => ";
249-
Doc.text ident;
246+
Doc.text "(.) => ";
247+
printOutTypeDoc typ;
250248
]
251249
| Otyp_constr (
252250
Oide_dot (Oide_dot (Oide_ident "Js", "Fn") , ident), (* Js.Fn.arity2 *)
@@ -352,7 +350,7 @@ let printPolyVarIdent txt =
352350
let i = ref 0 in
353351
let package = Doc.join ~sep:Doc.line ((List.map2 [@doesNotRaise]) (fun lbl typ ->
354352
Doc.concat [
355-
Doc.text (if i.contents > 0 then "and type " else "with type ");
353+
Doc.text (if i.contents > 0 then "and " else "with ");
356354
Doc.text lbl;
357355
Doc.text " = ";
358356
printOutTypeDoc typ;

0 commit comments

Comments
 (0)