@@ -1410,17 +1410,22 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover
1410
1410
fallbackOrEmpty ~items () )
1411
1411
| None -> fallbackOrEmpty () )
1412
1412
| Cexpression {contextPath; prefix; nested} -> (
1413
+ (* Completions for local things like variables in scope, modules in the project, etc. *)
1414
+ let regularCompletions =
1415
+ prefix
1416
+ |> getComplementaryCompletionsForTypedValue ~opens ~all Files ~env ~scope
1417
+ in
1413
1418
match
1414
1419
contextPath
1415
1420
|> getCompletionsForContextPath ~full ~opens ~raw Opens ~all Files ~pos ~env
1416
1421
~exact: true ~scope
1417
1422
|> completionsGetCompletionType ~full
1418
1423
with
1419
- | None -> []
1424
+ | None -> regularCompletions
1420
1425
| Some (typ , env ) -> (
1421
1426
match typ |> TypeUtils. resolveNested ~env ~full ~nested with
1422
- | None -> []
1423
- | Some (typ , env , completionContext ) -> (
1427
+ | None -> regularCompletions
1428
+ | Some (typ , _env , completionContext ) -> (
1424
1429
(* Wrap the insert text in braces when we're completing the root of a
1425
1430
JSX prop value. *)
1426
1431
let wrapInsertTextInBraces =
@@ -1448,12 +1453,6 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover
1448
1453
match (prefix, completionContext) with
1449
1454
| "" , _ -> items
1450
1455
| _ , None ->
1451
- (* Completions for local things like variables in scope, modules in the project, etc. *)
1452
- let regularCompletions =
1453
- prefix
1454
- |> getComplementaryCompletionsForTypedValue ~opens ~all Files ~env
1455
- ~scope
1456
- in
1457
1456
let items =
1458
1457
if List. length regularCompletions > 0 then
1459
1458
(* The client will occasionally sort the list of completions alphabetically, disregarding the order
0 commit comments