File tree Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -711,13 +711,17 @@ let detail name (kind : Completion.kind) =
711
711
| FileModule _ -> " file module"
712
712
| Field ({typ} , s ) -> name ^ " : " ^ (typ |> Shared. typeToString) ^ " \n\n " ^ s
713
713
| Constructor (c , s ) -> showConstructor c ^ " \n\n " ^ s
714
- | PolyvariantConstructor ({name; payload } , s ) ->
714
+ | PolyvariantConstructor ({name; args } , s ) ->
715
715
" #" ^ name
716
- ^ (match payload with
717
- | None -> " "
718
- | Some ({desc = Types. Ttuple _ } as typeExpr ) ->
719
- typeExpr |> Shared. typeToString
720
- | Some typeExpr -> " (" ^ (typeExpr |> Shared. typeToString) ^ " )" )
716
+ ^ (match args with
717
+ | [] -> " "
718
+ | [typeExpr] -> typeExpr |> Shared. typeToString
719
+ | typeExprs ->
720
+ " ("
721
+ ^ (typeExprs
722
+ |> List. map (fun typeExpr -> typeExpr |> Shared. typeToString)
723
+ |> String. concat " , " )
724
+ ^ " )" )
721
725
^ " \n\n " ^ s
722
726
723
727
let findAllCompletions ~(env : QueryEnv.t ) ~prefix ~exact ~namesUsed
@@ -1533,10 +1537,6 @@ let rec extractType ~env ~package (t : Types.type_expr) =
1533
1537
|> List. map (fun (label , field ) ->
1534
1538
{
1535
1539
name = label;
1536
- payload =
1537
- (match field with
1538
- | Types. Rpresent maybeTypeExpr -> maybeTypeExpr
1539
- | _ -> None );
1540
1540
args =
1541
1541
(* Multiple arguments are represented as a Ttuple, while a single argument is just the type expression itself. *)
1542
1542
(match field with
Original file line number Diff line number Diff line change @@ -279,11 +279,7 @@ end = struct
279
279
{env with exported = structure.exported; pathRev; parent = Some env}
280
280
end
281
281
282
- type polyVariantConstructor = {
283
- name : string ;
284
- payload : Types .type_expr option ;
285
- args : Types .type_expr list ;
286
- }
282
+ type polyVariantConstructor = {name : string ; args : Types .type_expr list }
287
283
288
284
module Completion = struct
289
285
type kind =
You can’t perform that action at this time.
0 commit comments