@@ -499,7 +499,7 @@ let resolveOpens ~env ~previous opens ~package =
499499let completionForDeclareds ~pos declareds prefix transformContents =
500500 (* Log.log("completion for declares " ++ prefix); *)
501501 Hashtbl. fold
502- (fun _stamp declared results ->
502+ (fun _stamp ( declared : _ Declared.t ) results ->
503503 if
504504 Utils. startsWith declared.name.txt prefix
505505 && Utils. locationContainsFuzzy declared.scopeLoc pos
@@ -522,8 +522,8 @@ let completionForDeclaredTypes ~pos ~env ~suffix =
522522 Kind. Type m)
523523
524524let completionForExporteds exporteds
525- (stamps : (int, 'a SharedTypes.declared ) Hashtbl.t ) prefix transformContents
526- =
525+ (stamps : (int, _ Declared.t ) Hashtbl.t ) prefix
526+ transformContents =
527527 Hashtbl. fold
528528 (fun name stamp results ->
529529 (* Log.log("checking exported: " ++ name); *)
@@ -550,7 +550,7 @@ let completionForConstructors ~(env : QueryEnv.t) ~suffix =
550550 (fun _name stamp results ->
551551 let t = Hashtbl. find env.file.stamps.types stamp in
552552 match t.item.kind with
553- | SharedTypes. Type.Variant constructors ->
553+ | Type. Variant constructors ->
554554 (constructors
555555 |> List. filter (fun c ->
556556 Utils. startsWith c.Constructor. cname.txt suffix)
@@ -560,7 +560,7 @@ let completionForConstructors ~(env : QueryEnv.t) ~suffix =
560560 env.exported.types []
561561 |> List. map (fun (c , t ) ->
562562 {
563- (emptyDeclared c.Constructor. cname.txt) with
563+ (Declared. empty c.Constructor. cname.txt) with
564564 item = Kind. Constructor (c, t);
565565 })
566566
@@ -577,7 +577,7 @@ let completionForFields ~(env : QueryEnv.t) ~suffix =
577577 | _ -> results)
578578 env.exported.types []
579579 |> 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)})
581581
582582let isCapitalized name =
583583 if name = " " then false
@@ -799,7 +799,7 @@ let getItems ~full ~rawOpens ~allFiles ~pos ~dotpath =
799799 (fun results env ->
800800 let completionsFromThisOpen = valueCompletions ~env suffix in
801801 List. filter
802- (fun (declared , _env ) ->
802+ (fun (( declared : Kind.t Declared.t ) , _env ) ->
803803 if Hashtbl. mem alreadyUsedIdentifiers declared.name.txt then
804804 false
805805 else (
@@ -816,7 +816,7 @@ let getItems ~full ~rawOpens ~allFiles ~pos ~dotpath =
816816 if Utils. startsWith name suffix && not (String. contains name '-' )
817817 then
818818 Some
819- ({(emptyDeclared name) with item = Kind. FileModule name}, env)
819+ ({(Declared. empty name) with item = Kind. FileModule name}, env)
820820 else None )
821821 in
822822 locallyDefinedValues @ valuesFromOpens @ localModuleNames
@@ -833,7 +833,7 @@ let getItems ~full ~rawOpens ~allFiles ~pos ~dotpath =
833833 | RecordAccess (valuePath , middleFields , lastField ) -> (
834834 Log. log (" lastField :" ^ lastField);
835835 Log. log
836- (" -------------- Looking for " ^ (valuePath |> SharedTypes. pathToString));
836+ (" -------------- Looking for " ^ (valuePath |> pathToString));
837837 match getEnvWithOpens ~pos ~env ~package ~opens valuePath with
838838 | Some (env , name ) -> (
839839 match ProcessCmt. findInScope pos name env.file.stamps.values with
@@ -866,7 +866,7 @@ let getItems ~full ~rawOpens ~allFiles ~pos ~dotpath =
866866 if Utils. startsWith field.fname.txt lastField then
867867 Some
868868 ( {
869- (emptyDeclared field.fname.txt) with
869+ (Declared. empty field.fname.txt) with
870870 item = Kind. Field (field, typ);
871871 },
872872 env )
@@ -922,7 +922,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
922922 let declareds = processDotPath ~exact: true (componentPath @ [" make" ]) in
923923 let labels =
924924 match declareds with
925- | ({SharedTypes .item = Kind. Value typ } , _env ) :: _ ->
925+ | ({Declared .item = Kind. Value typ } , _env ) :: _ ->
926926 let rec getFields (texp : Types.type_expr ) =
927927 match texp.desc with
928928 | Tfield (name , _ , t1 , t2 ) ->
@@ -982,8 +982,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
982982 (* TODO(#107): figure out why we're getting duplicates. *)
983983 declareds |> Utils. dedup
984984 |> List. map
985- (fun
986- ({SharedTypes. name = {txt = name } ; deprecated; docstring; item} , _env )
985+ (fun ({Declared. name = {txt = name } ; deprecated; docstring; item} , _env )
987986 ->
988987 mkItem ~name ~kind: (Kind. toInt item) ~deprecated
989988 ~detail: (detail name item) ~docstring )
@@ -1028,7 +1027,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
10281027 match
10291028 fields
10301029 |> List. find_opt (fun field ->
1031- field.SharedTypes. fname.txt = fieldName)
1030+ field.fname.txt = fieldName)
10321031 with
10331032 | None -> None
10341033 | Some field -> Some (field.typ, env1))
@@ -1044,7 +1043,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
10441043 match String. split_on_char '.' pipeId with
10451044 | x :: fieldNames -> (
10461045 match [x] |> processDotPath ~exact: true with
1047- | ({SharedTypes .item = Value typ } , env ) :: _ -> (
1046+ | ({Declared .item = Value typ } , env ) :: _ -> (
10481047 match getFields ~env ~typ fieldNames with
10491048 | None -> None
10501049 | Some (typ1 , _env1 ) -> fromType typ1)
@@ -1095,11 +1094,11 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
10951094 let dotpath = modulePath @ [partialName] in
10961095 let declareds = dotpath |> processDotPath ~exact: false in
10971096 declareds
1098- |> List. filter (fun ({item} , _env ) ->
1097+ |> List. filter (fun ({Declared. item} , _env ) ->
10991098 match item with Kind. Value _ -> true | _ -> false )
11001099 |> List. map
11011100 (fun
1102- ( {SharedTypes .name = {txt = name } ; deprecated; docstring; item} ,
1101+ ( {Declared .name = {txt = name } ; deprecated; docstring; item} ,
11031102 _env )
11041103 ->
11051104 mkItem ~name: (completionName name) ~kind: (Kind. toInt item)
@@ -1153,7 +1152,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
11531152 | Clabel (funPath , prefix , identsSeen ) ->
11541153 let labels =
11551154 match funPath |> processDotPath ~exact: true with
1156- | ({SharedTypes .item = Value typ } , _env ) :: _ ->
1155+ | ({Declared .item = Value typ } , _env ) :: _ ->
11571156 let rec getLabels (t : Types.type_expr ) =
11581157 match t.desc with
11591158 | Tlink t1 | Tsubst t1 -> getLabels t1
@@ -1202,7 +1201,7 @@ let processCompletable ~processDotPath ~full ~package ~rawOpens
12021201 let env0 = QueryEnv. fromFile full.file in
12031202 let env, fields =
12041203 match lhs |> processDotPath ~exact: true with
1205- | ({SharedTypes .item = Value typ } , env ) :: _ -> getObjectFields ~env typ
1204+ | ({Declared .item = Value typ } , env ) :: _ -> getObjectFields ~env typ
12061205 | _ -> (env0, [] )
12071206 in
12081207 let labels = resolvePath ~env fields path in
@@ -1243,7 +1242,7 @@ let computeCompletions ~completable ~full ~pos ~rawOpens =
12431242 let rec prioritize decls =
12441243 match decls with
12451244 | (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
12471246 if pos2 > = pos then prioritize ((d1, e1) :: rest)
12481247 else
12491248 let pos1 = d1.extentLoc.loc_start |> Utils. tupleOfLexing in
@@ -1252,7 +1251,7 @@ let computeCompletions ~completable ~full ~pos ~rawOpens =
12521251 | [] | [_] -> decls
12531252 in
12541253 declareds
1255- |> List. filter (fun ({SharedTypes .name = {txt} } , _env ) -> txt = last)
1254+ |> List. filter (fun ({Declared .name = {txt} } , _env ) -> txt = last)
12561255 |> prioritize
12571256 | _ -> declareds
12581257 in
0 commit comments