Skip to content

Commit f628fc0

Browse files
committed
remove things from type extraction that will be added in separate PRs
1 parent 25482f0 commit f628fc0

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

analysis/src/CompletionBackEnd.ml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,8 +1484,6 @@ let getArgs ~env (t : Types.type_expr) ~full =
14841484
t |> getArgsLoop ~env ~full ~currentArgumentPosition:0
14851485

14861486
type extractedType =
1487-
| Declared of QueryEnv.t * Type.t Declared.t
1488-
| Polyvariant of QueryEnv.t * SharedTypes.polyVariantConstructor list
14891487
| Tuple of QueryEnv.t * Types.type_expr list
14901488
| Toption of QueryEnv.t * Types.type_expr
14911489
| Tbool of QueryEnv.t
@@ -1500,35 +1498,6 @@ let rec extractType ~env ~package (t : Types.type_expr) =
15001498
| Tconstr (Path.Pident {name = "bool"}, [], _) ->
15011499
(* Handle bool. TODO: Look up how the compiler does this and copy that behavior. *)
15021500
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))
15321501
| Ttuple expressions -> Some (Tuple (env, expressions))
15331502
| _ -> None
15341503

0 commit comments

Comments
 (0)