@@ -499,7 +499,7 @@ let resolveOpens ~env ~previous opens ~package =
499
499
let completionForDeclareds ~pos declareds prefix transformContents =
500
500
(* Log.log("completion for declares " ++ prefix); *)
501
501
Hashtbl. fold
502
- (fun _stamp declared results ->
502
+ (fun _stamp ( declared : _ Declared.t ) results ->
503
503
if
504
504
Utils. startsWith declared.name.txt prefix
505
505
&& Utils. locationContainsFuzzy declared.scopeLoc pos
@@ -522,8 +522,8 @@ let completionForDeclaredTypes ~pos ~env ~suffix =
522
522
Kind. Type m)
523
523
524
524
let completionForExporteds exporteds
525
- (stamps : (int, 'a SharedTypes.declared ) Hashtbl.t ) prefix transformContents
526
- =
525
+ (stamps : (int, _ Declared.t ) Hashtbl.t ) prefix
526
+ transformContents =
527
527
Hashtbl. fold
528
528
(fun name stamp results ->
529
529
(* Log.log("checking exported: " ++ name); *)
@@ -550,7 +550,7 @@ let completionForConstructors ~(env : QueryEnv.t) ~suffix =
550
550
(fun _name stamp results ->
551
551
let t = Hashtbl. find env.file.stamps.types stamp in
552
552
match t.item.kind with
553
- | SharedTypes. Type.Variant constructors ->
553
+ | Type. Variant constructors ->
554
554
(constructors
555
555
|> List. filter (fun c ->
556
556
Utils. startsWith c.Constructor. cname.txt suffix)
@@ -560,7 +560,7 @@ let completionForConstructors ~(env : QueryEnv.t) ~suffix =
560
560
env.exported.types []
561
561
|> List. map (fun (c , t ) ->
562
562
{
563
- (emptyDeclared c.Constructor. cname.txt) with
563
+ (Declared. empty c.Constructor. cname.txt) with
564
564
item = Kind. Constructor (c, t);
565
565
})
566
566
@@ -577,7 +577,7 @@ let completionForFields ~(env : QueryEnv.t) ~suffix =
577
577
| _ -> results)
578
578
env.exported.types []
579
579
|> List. map (fun (f , t ) ->
580
- {(emptyDeclared f.fname.txt) with item = Kind. Field (f, t)})
580
+ {(Declared. empty f.fname.txt) with item = Kind. Field (f, t)})
581
581
582
582
let isCapitalized name =
583
583
if name = " " then false
@@ -799,7 +799,7 @@ let getItems ~full ~rawOpens ~allFiles ~pos ~dotpath =
799
799
(fun results env ->
800
800
let completionsFromThisOpen = valueCompletions ~env suffix in
801
801
List. filter
802
- (fun (declared , _env ) ->
802
+ (fun (( declared : Kind.t Declared.t ) , _env ) ->
803
803
if Hashtbl. mem alreadyUsedIdentifiers declared.name.txt then
804
804
false
805
805
else (
@@ -816,7 +816,7 @@ let getItems ~full ~rawOpens ~allFiles ~pos ~dotpath =
816
816
if Utils. startsWith name suffix && not (String. contains name '-' )
817
817
then
818
818
Some
819
- ({(emptyDeclared name) with item = Kind. FileModule name}, env)
819
+ ({(Declared. empty name) with item = Kind. FileModule name}, env)
820
820
else None )
821
821
in
822
822
locallyDefinedValues @ valuesFromOpens @ localModuleNames
@@ -833,7 +833,7 @@ let getItems ~full ~rawOpens ~allFiles ~pos ~dotpath =
833
833
| RecordAccess (valuePath , middleFields , lastField ) -> (
834
834
Log. log (" lastField :" ^ lastField);
835
835
Log. log
836
- (" -------------- Looking for " ^ (valuePath |> SharedTypes. pathToString));
836
+ (" -------------- Looking for " ^ (valuePath |> pathToString));
837
837
match getEnvWithOpens ~pos ~env ~package ~opens valuePath with
838
838
| Some (env , name ) -> (
839
839
match ProcessCmt. findInScope pos name env.file.stamps.values with
@@ -866,7 +866,7 @@ let getItems ~full ~rawOpens ~allFiles ~pos ~dotpath =
866
866
if Utils. startsWith field.fname.txt lastField then
867
867
Some
868
868
( {
869
- (emptyDeclared field.fname.txt) with
869
+ (Declared. empty field.fname.txt) with
870
870
item = Kind. Field (field, typ);
871
871
},
872
872
env )
@@ -922,7 +922,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
922
922
let declareds = processDotPath ~exact: true (componentPath @ [" make" ]) in
923
923
let labels =
924
924
match declareds with
925
- | ({SharedTypes .item = Kind. Value typ } , _env ) :: _ ->
925
+ | ({Declared .item = Kind. Value typ } , _env ) :: _ ->
926
926
let rec getFields (texp : Types.type_expr ) =
927
927
match texp.desc with
928
928
| Tfield (name , _ , t1 , t2 ) ->
@@ -982,8 +982,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
982
982
(* TODO(#107): figure out why we're getting duplicates. *)
983
983
declareds |> Utils. dedup
984
984
|> List. map
985
- (fun
986
- ({SharedTypes. name = {txt = name } ; deprecated; docstring; item} , _env )
985
+ (fun ({Declared. name = {txt = name } ; deprecated; docstring; item} , _env )
987
986
->
988
987
mkItem ~name ~kind: (Kind. toInt item) ~deprecated
989
988
~detail: (detail name item) ~docstring )
@@ -1028,7 +1027,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
1028
1027
match
1029
1028
fields
1030
1029
|> List. find_opt (fun field ->
1031
- field.SharedTypes. fname.txt = fieldName)
1030
+ field.fname.txt = fieldName)
1032
1031
with
1033
1032
| None -> None
1034
1033
| Some field -> Some (field.typ, env1))
@@ -1044,7 +1043,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
1044
1043
match String. split_on_char '.' pipeId with
1045
1044
| x :: fieldNames -> (
1046
1045
match [x] |> processDotPath ~exact: true with
1047
- | ({SharedTypes .item = Value typ } , env ) :: _ -> (
1046
+ | ({Declared .item = Value typ } , env ) :: _ -> (
1048
1047
match getFields ~env ~typ fieldNames with
1049
1048
| None -> None
1050
1049
| Some (typ1 , _env1 ) -> fromType typ1)
@@ -1095,11 +1094,11 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
1095
1094
let dotpath = modulePath @ [partialName] in
1096
1095
let declareds = dotpath |> processDotPath ~exact: false in
1097
1096
declareds
1098
- |> List. filter (fun ({item} , _env ) ->
1097
+ |> List. filter (fun ({Declared. item} , _env ) ->
1099
1098
match item with Kind. Value _ -> true | _ -> false )
1100
1099
|> List. map
1101
1100
(fun
1102
- ( {SharedTypes .name = {txt = name } ; deprecated; docstring; item} ,
1101
+ ( {Declared .name = {txt = name } ; deprecated; docstring; item} ,
1103
1102
_env )
1104
1103
->
1105
1104
mkItem ~name: (completionName name) ~kind: (Kind. toInt item)
@@ -1153,7 +1152,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
1153
1152
| Clabel (funPath , prefix , identsSeen ) ->
1154
1153
let labels =
1155
1154
match funPath |> processDotPath ~exact: true with
1156
- | ({SharedTypes .item = Value typ } , _env ) :: _ ->
1155
+ | ({Declared .item = Value typ } , _env ) :: _ ->
1157
1156
let rec getLabels (t : Types.type_expr ) =
1158
1157
match t.desc with
1159
1158
| Tlink t1 | Tsubst t1 -> getLabels t1
@@ -1202,7 +1201,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
1202
1201
let env0 = QueryEnv. fromFile full.file in
1203
1202
let env, fields =
1204
1203
match lhs |> processDotPath ~exact: true with
1205
- | ({SharedTypes .item = Value typ } , env ) :: _ -> getObjectFields ~env typ
1204
+ | ({Declared .item = Value typ } , env ) :: _ -> getObjectFields ~env typ
1206
1205
| _ -> (env0, [] )
1207
1206
in
1208
1207
let labels = resolvePath ~env fields path in
@@ -1243,7 +1242,7 @@ let computeCompletions ~completable ~full ~pos ~rawOpens =
1243
1242
let rec prioritize decls =
1244
1243
match decls with
1245
1244
| (d1 , e1 ) :: (d2 , e2 ) :: rest ->
1246
- let pos2 = d2.extentLoc.loc_start |> Utils. tupleOfLexing in
1245
+ let pos2 = d2.Declared. extentLoc.loc_start |> Utils. tupleOfLexing in
1247
1246
if pos2 > = pos then prioritize ((d1, e1) :: rest)
1248
1247
else
1249
1248
let pos1 = d1.extentLoc.loc_start |> Utils. tupleOfLexing in
@@ -1252,7 +1251,7 @@ let computeCompletions ~completable ~full ~pos ~rawOpens =
1252
1251
| [] | [_] -> decls
1253
1252
in
1254
1253
declareds
1255
- |> List. filter (fun ({SharedTypes .name = {txt} } , _env ) -> txt = last)
1254
+ |> List. filter (fun ({Declared .name = {txt} } , _env ) -> txt = last)
1256
1255
|> prioritize
1257
1256
| _ -> declareds
1258
1257
in
0 commit comments