Skip to content

Commit 490ed6c

Browse files
committed
cleanup
1 parent 04e198b commit 490ed6c

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

analysis/src/CompletionBackEnd.ml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,23 +1483,12 @@ let getArgs ~env (t : Types.type_expr) ~full =
14831483
in
14841484
t |> getArgsLoop ~env ~full ~currentArgumentPosition:0
14851485

1486-
type extractedType =
1487-
| Tuple of QueryEnv.t * Types.type_expr list
1488-
| Toption of QueryEnv.t * Types.type_expr
1489-
| Tbool of QueryEnv.t
1490-
| Tvariant of {
1491-
env: QueryEnv.t;
1492-
constructors: Constructor.t list;
1493-
variantDecl: Types.type_declaration;
1494-
variantName: string;
1495-
}
1496-
1497-
(* This is a more general extraction function for pulling out the type of a type_expr. We already have other similar functions, but they are all specialized on something (variants, records, etc). *)
1486+
(** Pulls out a type we can complete from a type expr. *)
14981487
let rec extractType ~env ~package (t : Types.type_expr) =
14991488
match t.desc with
15001489
| Tlink t1 | Tsubst t1 | Tpoly (t1, []) -> extractType ~env ~package t1
15011490
| Tconstr (Path.Pident {name = "option"}, [payloadTypeExpr], _) ->
1502-
Some (Toption (env, payloadTypeExpr))
1491+
Some (Completable.Toption (env, payloadTypeExpr))
15031492
| Tconstr (Path.Pident {name = "bool"}, [], _) -> Some (Tbool env)
15041493
| Tconstr (path, _, _) -> (
15051494
match References.digConstructor ~env ~package path with

analysis/src/SharedTypes.ml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,18 @@ module Completable = struct
536536
prefix: string;
537537
}
538538

539+
(** An extracted type from a type expr *)
540+
type extractedType =
541+
| Tuple of QueryEnv.t * Types.type_expr list
542+
| Toption of QueryEnv.t * Types.type_expr
543+
| Tbool of QueryEnv.t
544+
| Tvariant of {
545+
env: QueryEnv.t;
546+
constructors: Constructor.t list;
547+
variantDecl: Types.type_declaration;
548+
variantName: string;
549+
}
550+
539551
let toString =
540552
let completionContextToString = function
541553
| Value -> "Value"

0 commit comments

Comments
 (0)