@@ -754,7 +754,7 @@ let rec extractObjectType ~env ~package (t : Types.type_expr) =
754
754
| _ -> None )
755
755
| _ -> None
756
756
757
- let getItems ~full ~rawOpens ~allFiles ~pos ~parts =
757
+ let getItems ~full ~rawOpens ~allFiles ~pos ~dotpath =
758
758
Log. log
759
759
(" Opens folkz > "
760
760
^ string_of_int (List. length rawOpens)
@@ -774,7 +774,7 @@ let getItems ~full ~rawOpens ~allFiles ~pos ~parts =
774
774
|> List. map (fun (e : QueryEnv.t ) -> Uri2. toString e.file.uri)));
775
775
(* Last open takes priority *)
776
776
let opens = List. rev resolvedOpens in
777
- match parts with
777
+ match dotpath with
778
778
| [] -> []
779
779
| [suffix] ->
780
780
let locallyDefinedValues = localValueCompletions ~pos ~env suffix in
@@ -882,7 +882,7 @@ let mkItem ~name ~kind ~detail ~deprecated ~docstring =
882
882
else Some {kind = " markdown" ; value = docContent});
883
883
}
884
884
885
- let processCompletable ~findItems ~full ~package ~rawOpens
885
+ let processCompletable ~processDotPath ~full ~package ~rawOpens
886
886
(completable : PartialParser.completable ) =
887
887
match completable with
888
888
| Cjsx ([id ], prefix , identsSeen ) when String. lowercase_ascii id = id ->
@@ -901,9 +901,9 @@ let processCompletable ~findItems ~full ~package ~rawOpens
901
901
|> List. map mkLabel)
902
902
@ keyLabels
903
903
| Cjsx (componentPath , prefix , identsSeen ) ->
904
- let items = findItems ~exact: true (componentPath @ [" make" ]) in
904
+ let declareds = processDotPath ~exact: true (componentPath @ [" make" ]) in
905
905
let labels =
906
- match items with
906
+ match declareds with
907
907
| {SharedTypes. item = Value typ } :: _ ->
908
908
let rec getFields (texp : Types.type_expr ) =
909
909
match texp.desc with
@@ -959,10 +959,10 @@ let processCompletable ~findItems ~full ~package ~rawOpens
959
959
Utils. startsWith name prefix && not (List. mem name identsSeen))
960
960
|> List. map mkLabel)
961
961
@ keyLabels
962
- | Cpath parts ->
963
- let items = parts |> findItems ~exact: false in
962
+ | Cdotpath dotpath ->
963
+ let declareds = dotpath |> processDotPath ~exact: false in
964
964
(* TODO(#107): figure out why we're getting duplicates. *)
965
- items |> Utils. dedup
965
+ declareds |> Utils. dedup
966
966
|> List. map
967
967
(fun {SharedTypes. name = {txt = name } ; deprecated; docstring; item} ->
968
968
mkItem ~name ~kind: (kindToInt item) ~deprecated
@@ -1023,7 +1023,7 @@ let processCompletable ~findItems ~full ~package ~rawOpens
1023
1023
in
1024
1024
match String. split_on_char '.' pipeId with
1025
1025
| x :: fieldNames -> (
1026
- match [x] |> findItems ~exact: true with
1026
+ match [x] |> processDotPath ~exact: true with
1027
1027
| {SharedTypes. item = Value typ } :: _ -> (
1028
1028
let env = QueryEnv. fromFile full.file in
1029
1029
match getFields ~env ~typ fieldNames with
@@ -1073,9 +1073,9 @@ let processCompletable ~findItems ~full ~package ~rawOpens
1073
1073
if modulePathMinusOpens = " " then name
1074
1074
else modulePathMinusOpens ^ " ." ^ name
1075
1075
in
1076
- let parts = modulePath @ [partialName] in
1077
- let items = parts |> findItems ~exact: false in
1078
- items
1076
+ let dotpath = modulePath @ [partialName] in
1077
+ let declareds = dotpath |> processDotPath ~exact: false in
1078
+ declareds
1079
1079
|> List. filter (fun {item} ->
1080
1080
match item with Value _ -> true | _ -> false )
1081
1081
|> List. map
@@ -1131,7 +1131,7 @@ let processCompletable ~findItems ~full ~package ~rawOpens
1131
1131
|> List. map mkDecorator
1132
1132
| Clabel (funPath , prefix , identsSeen ) ->
1133
1133
let labels =
1134
- match funPath |> findItems ~exact: true with
1134
+ match funPath |> processDotPath ~exact: true with
1135
1135
| {SharedTypes. item = Value typ } :: _ ->
1136
1136
let rec getLabels (t : Types.type_expr ) =
1137
1137
match t.desc with
@@ -1180,7 +1180,7 @@ let processCompletable ~findItems ~full ~package ~rawOpens
1180
1180
in
1181
1181
let env0 = QueryEnv. fromFile full.file in
1182
1182
let env, fields =
1183
- match [lhs] |> findItems ~exact: true with
1183
+ match [lhs] |> processDotPath ~exact: true with
1184
1184
| {SharedTypes. item = Value typ } :: _ -> getObjectFields ~env: env0 typ
1185
1185
| _ -> (env0, [] )
1186
1186
in
@@ -1211,11 +1211,11 @@ let getCompletable ~textOpt ~pos =
1211
1211
let computeCompletions ~completable ~full ~pos ~rawOpens =
1212
1212
let package = full.package in
1213
1213
let allFiles = FileSet. union package.projectFiles package.dependenciesFiles in
1214
- let findItems ~exact parts =
1215
- let items = getItems ~full ~raw Opens ~all Files ~pos ~parts in
1216
- match parts |> List. rev with
1214
+ let processDotPath ~exact dotpath =
1215
+ let items = getItems ~full ~raw Opens ~all Files ~pos ~dotpath in
1216
+ match dotpath |> List. rev with
1217
1217
| last :: _ when exact ->
1218
1218
items |> List. filter (fun {SharedTypes. name = {txt} } -> txt = last)
1219
1219
| _ -> items
1220
1220
in
1221
- completable |> processCompletable ~find Items ~full ~package ~raw Opens
1221
+ completable |> processCompletable ~process DotPath ~full ~package ~raw Opens
0 commit comments