Skip to content

Commit 4378d76

Browse files
committed
comment + clarify prop name
1 parent 490ed6c commit 4378d76

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

analysis/src/CompletionBackEnd.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,10 +1942,10 @@ Note: The `@react.component` decorator requires the react-jsx config to be set i
19421942
in
19431943
(dec2, doc))
19441944
|> List.map mkDecorator
1945-
| Cargument {contextPath; argumentLabel; prefix} -> (
1945+
| Cargument {functionContextPath; argumentLabel; prefix} -> (
19461946
let labels =
19471947
match
1948-
contextPath
1948+
functionContextPath
19491949
|> getCompletionsForContextPath ~full ~opens ~rawOpens ~allFiles ~pos
19501950
~env ~exact:true ~scope
19511951
|> completionsGetTypeEnv

analysis/src/CompletionFrontEnd.ml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,19 @@ let findArgCompletables ~(args : arg list) ~endPos ~posBeforeCursor
142142
| Some prefix ->
143143
Some
144144
(Cargument
145-
{contextPath; argumentLabel = Labelled labelled.name; prefix})
145+
{
146+
functionContextPath = contextPath;
147+
argumentLabel = Labelled labelled.name;
148+
prefix;
149+
})
146150
else if isExprHole exp then
147151
Some
148152
(Cargument
149-
{contextPath; argumentLabel = Labelled labelled.name; prefix = ""})
153+
{
154+
functionContextPath = contextPath;
155+
argumentLabel = Labelled labelled.name;
156+
prefix = "";
157+
})
150158
else loop rest
151159
| {label = None; exp} :: rest ->
152160
if Res_parsetree_viewer.isTemplateLiteral exp then None
@@ -158,7 +166,7 @@ let findArgCompletables ~(args : arg list) ~endPos ~posBeforeCursor
158166
Some
159167
(Cargument
160168
{
161-
contextPath;
169+
functionContextPath = contextPath;
162170
argumentLabel =
163171
Unlabelled {argumentPosition = !unlabelledCount};
164172
prefix;
@@ -167,7 +175,7 @@ let findArgCompletables ~(args : arg list) ~endPos ~posBeforeCursor
167175
Some
168176
(Cargument
169177
{
170-
contextPath;
178+
functionContextPath = contextPath;
171179
argumentLabel = Unlabelled {argumentPosition = !unlabelledCount};
172180
prefix = "";
173181
})

analysis/src/SharedTypes.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,11 @@ module Completable = struct
531531
| Cjsx of string list * string * string list
532532
(** E.g. (["M", "Comp"], "id", ["id1", "id2"]) for <M.Comp id1=... id2=... ... id *)
533533
| Cargument of {
534-
contextPath: contextPath;
534+
functionContextPath: contextPath;
535535
argumentLabel: argumentLabel;
536536
prefix: string;
537537
}
538+
(** e.g. someFunction(~someBoolArg=<com>), complete for the value of `someBoolArg` (true or false). *)
538539

539540
(** An extracted type from a type expr *)
540541
type extractedType =
@@ -585,8 +586,8 @@ module Completable = struct
585586
| Cnone -> "Cnone"
586587
| Cjsx (sl1, s, sl2) ->
587588
"Cjsx(" ^ (sl1 |> list) ^ ", " ^ str s ^ ", " ^ (sl2 |> list) ^ ")"
588-
| Cargument {contextPath; argumentLabel; prefix} ->
589-
contextPathToString contextPath
589+
| Cargument {functionContextPath; argumentLabel; prefix} ->
590+
contextPathToString functionContextPath
590591
^ "("
591592
^ (match argumentLabel with
592593
| Unlabelled {argumentPosition} -> "$" ^ string_of_int argumentPosition

0 commit comments

Comments
 (0)