@@ -1410,17 +1410,22 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover
14101410 fallbackOrEmpty ~items () )
14111411 | None -> fallbackOrEmpty () )
14121412 | 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
14131418 match
14141419 contextPath
14151420 |> getCompletionsForContextPath ~full ~opens ~raw Opens ~all Files ~pos ~env
14161421 ~exact: true ~scope
14171422 |> completionsGetCompletionType ~full
14181423 with
1419- | None -> []
1424+ | None -> regularCompletions
14201425 | Some (typ , env ) -> (
14211426 match typ |> TypeUtils. resolveNested ~env ~full ~nested with
1422- | None -> []
1423- | Some (typ , env , completionContext ) -> (
1427+ | None -> regularCompletions
1428+ | Some (typ , _env , completionContext ) -> (
14241429 (* Wrap the insert text in braces when we're completing the root of a
14251430 JSX prop value. *)
14261431 let wrapInsertTextInBraces =
@@ -1448,12 +1453,6 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover
14481453 match (prefix, completionContext) with
14491454 | "" , _ -> items
14501455 | _ , 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
14571456 let items =
14581457 if List. length regularCompletions > 0 then
14591458 (* The client will occasionally sort the list of completions alphabetically, disregarding the order
0 commit comments