Skip to content

Commit 7301624

Browse files
committed
fix nested record
1 parent 4c8dce3 commit 7301624

File tree

2 files changed

+5
-41
lines changed

2 files changed

+5
-41
lines changed

analysis/src/CompletionFrontEnd.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ let findJsxPropsCompletable ~jsxProps ~endPos ~posBeforeCursor
129129
Utils.flattenLongIdent ~jsx:true jsxProps.compName.txt;
130130
prefix;
131131
propName = prop.name;
132-
nested;
132+
nested = List.rev nested;
133133
})
134134
| _ -> None
135135
else if prop.exp.pexp_loc |> Loc.end_ = (Location.none |> Loc.end_) then
@@ -237,7 +237,7 @@ let findArgCompletables ~(args : arg list) ~endPos ~posBeforeCursor
237237
functionContextPath = contextPath;
238238
argumentLabel = Labelled labelled.name;
239239
prefix;
240-
nested;
240+
nested = List.rev nested;
241241
})
242242
else if isExprHole exp then
243243
Some
@@ -266,7 +266,7 @@ let findArgCompletables ~(args : arg list) ~endPos ~posBeforeCursor
266266
argumentLabel =
267267
Unlabelled {argumentPosition = !unlabelledCount};
268268
prefix;
269-
nested;
269+
nested = List.rev nested;
270270
})
271271
else if isExprHole exp then
272272
Some

analysis/tests/src/expected/CompletionExpressions.res.txt

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -172,42 +172,6 @@ Completable: Cargument Value[fnTakingRecord]($0)->recordField(nested)
172172
Complete src/CompletionExpressions.res 44:46
173173
posCursor:[44:46] posNoWhite:[44:45] Found expr:[44:11->44:49]
174174
Pexp_apply ...[44:11->44:25] (...[44:26->44:48])
175-
Completable: Cargument Value[fnTakingRecord]($0)->recordBody, recordField(nested)
176-
[{
177-
"label": "age",
178-
"kind": 5,
179-
"tags": [],
180-
"detail": "age: int\n\nsomeRecord",
181-
"documentation": null
182-
}, {
183-
"label": "offline",
184-
"kind": 5,
185-
"tags": [],
186-
"detail": "offline: bool\n\nsomeRecord",
187-
"documentation": null
188-
}, {
189-
"label": "online",
190-
"kind": 5,
191-
"tags": [],
192-
"detail": "online: option<bool>\n\nsomeRecord",
193-
"documentation": null
194-
}, {
195-
"label": "variant",
196-
"kind": 5,
197-
"tags": [],
198-
"detail": "variant: someVariant\n\nsomeRecord",
199-
"documentation": null
200-
}, {
201-
"label": "polyvariant",
202-
"kind": 5,
203-
"tags": [],
204-
"detail": "polyvariant: somePolyVariant\n\nsomeRecord",
205-
"documentation": null
206-
}, {
207-
"label": "nested",
208-
"kind": 5,
209-
"tags": [],
210-
"detail": "nested: option<otherRecord>\n\nsomeRecord",
211-
"documentation": null
212-
}]
175+
Completable: Cargument Value[fnTakingRecord]($0)->recordField(nested), recordBody
176+
[]
213177

0 commit comments

Comments
 (0)