@@ -454,28 +454,26 @@ let processLocalModule name loc ~prefix ~exact ~env
454
454
let processLocalInclude includePath _loc ~prefix ~exact ~(env : QueryEnv.t )
455
455
~(localTables : LocalTables.t ) =
456
456
(* process only values for now *)
457
- localTables.valueTable
458
- |> Hashtbl. iter (fun (name , _ ) (declared : Types.type_expr Declared.t ) ->
457
+ localTables.includedValueTable
458
+ |> Hashtbl. iter
459
+ (fun (name , _ ) (declared : (string * Types.type_expr) Declared.t ) ->
459
460
(* We check all the values if their origin is the same as the include path. *)
460
- match declared.modulePath with
461
- | ModulePath. IncludedModule (source , _ ) ->
462
- let source_module_path = Path. name source in
463
- if String. ends_with ~suffix: includePath source_module_path then
464
- (* If this is the case we perform a similar check for the prefix *)
465
- if Utils. checkName name ~prefix ~exact then
466
- if not (Hashtbl. mem localTables.namesUsed name) then (
467
- Hashtbl. add localTables.namesUsed name () ;
468
- localTables.resultRev < -
469
- {
470
- (Completion. create declared.name.txt ~env
471
- ~kind: (Value declared.item))
472
- with
473
- deprecated = declared.deprecated;
474
- docstring = declared.docstring;
475
- synthetic = true ;
476
- }
477
- :: localTables.resultRev)
478
- | _ -> () )
461
+ let source_module_path = fst declared.item in
462
+ if String. ends_with ~suffix: includePath source_module_path then
463
+ (* If this is the case we perform a similar check for the prefix *)
464
+ if Utils. checkName name ~prefix ~exact then
465
+ if not (Hashtbl. mem localTables.namesUsed name) then (
466
+ Hashtbl. add localTables.namesUsed name () ;
467
+ localTables.resultRev < -
468
+ {
469
+ (Completion. create declared.name.txt ~env
470
+ ~kind: (Value (snd declared.item)))
471
+ with
472
+ deprecated = declared.deprecated;
473
+ docstring = declared.docstring;
474
+ synthetic = true ;
475
+ }
476
+ :: localTables.resultRev))
479
477
480
478
let getItemsFromOpens ~opens ~localTables ~prefix ~exact ~completionContext =
481
479
opens
@@ -491,6 +489,7 @@ let getItemsFromOpens ~opens ~localTables ~prefix ~exact ~completionContext =
491
489
let findLocalCompletionsForValuesAndConstructors ~(localTables : LocalTables.t )
492
490
~env ~prefix ~exact ~opens ~scope =
493
491
localTables |> LocalTables. populateValues ~env ;
492
+ localTables |> LocalTables. populateIncludedValues ~env ;
494
493
localTables |> LocalTables. populateConstructors ~env ;
495
494
localTables |> LocalTables. populateModules ~env ;
496
495
@@ -527,6 +526,7 @@ let findLocalCompletionsForValuesAndConstructors ~(localTables : LocalTables.t)
527
526
let findLocalCompletionsForValues ~(localTables : LocalTables.t ) ~env ~prefix
528
527
~exact ~opens ~scope =
529
528
localTables |> LocalTables. populateValues ~env ;
529
+ localTables |> LocalTables. populateIncludedValues ~env ;
530
530
localTables |> LocalTables. populateModules ~env ;
531
531
scope
532
532
|> Scope. iterValuesBeforeFirstOpen
0 commit comments