@@ -1484,8 +1484,6 @@ let getArgs ~env (t : Types.type_expr) ~full =
1484
1484
t |> getArgsLoop ~env ~full ~current ArgumentPosition:0
1485
1485
1486
1486
type extractedType =
1487
- | Declared of QueryEnv .t * Type .t Declared .t
1488
- | Polyvariant of QueryEnv .t * SharedTypes .polyVariantConstructor list
1489
1487
| Tuple of QueryEnv .t * Types .type_expr list
1490
1488
| Toption of QueryEnv .t * Types .type_expr
1491
1489
| Tbool of QueryEnv .t
@@ -1500,35 +1498,6 @@ let rec extractType ~env ~package (t : Types.type_expr) =
1500
1498
| Tconstr (Path. Pident {name = "bool" } , [] , _ ) ->
1501
1499
(* Handle bool. TODO: Look up how the compiler does this and copy that behavior. *)
1502
1500
Some (Tbool env)
1503
- | Tconstr (path , _ , _ ) -> (
1504
- match References. digConstructor ~env ~package path with
1505
- | Some (env , {item = {decl = {type_manifest = Some t1 } } } ) ->
1506
- extractType ~env ~package t1
1507
- | Some (env , typ ) -> Some (Declared (env, typ))
1508
- | None -> None )
1509
- | Tvariant {row_fields} ->
1510
- (* Since polyvariants are strutural, they're "inlined". So, we extract just
1511
- what we need for completion from that definition here. *)
1512
- let constructors =
1513
- row_fields
1514
- |> List. map (fun (label , field ) ->
1515
- {
1516
- name = label;
1517
- payload =
1518
- (match field with
1519
- | Types. Rpresent maybeTypeExpr -> maybeTypeExpr
1520
- | _ -> None );
1521
- args =
1522
- (* Multiple arguments are represented as a Ttuple, while a single argument is just the type expression itself. *)
1523
- (match field with
1524
- | Types. Rpresent (Some typeExpr ) -> (
1525
- match typeExpr.desc with
1526
- | Ttuple args -> args
1527
- | _ -> [typeExpr])
1528
- | _ -> [] );
1529
- })
1530
- in
1531
- Some (Polyvariant (env, constructors))
1532
1501
| Ttuple expressions -> Some (Tuple (env, expressions))
1533
1502
| _ -> None
1534
1503
0 commit comments