@@ -454,28 +454,26 @@ let processLocalModule name loc ~prefix ~exact ~env
454454let  processLocalInclude  includePath  _loc  ~prefix   ~exact   ~(env  : QueryEnv.t )
455455    ~(localTables  : LocalTables.t ) = 
456456  (*  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 ) ->
459460         (*  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))
479477
480478let  getItemsFromOpens  ~opens   ~localTables   ~prefix   ~exact   ~completionContext   = 
481479  opens
@@ -491,6 +489,7 @@ let getItemsFromOpens ~opens ~localTables ~prefix ~exact ~completionContext =
491489let  findLocalCompletionsForValuesAndConstructors  ~(localTables  : LocalTables.t )
492490    ~env   ~prefix   ~exact   ~opens   ~scope   = 
493491  localTables |>  LocalTables. populateValues ~env ;
492+   localTables |>  LocalTables. populateIncludedValues ~env ;
494493  localTables |>  LocalTables. populateConstructors ~env ;
495494  localTables |>  LocalTables. populateModules ~env ;
496495
@@ -527,6 +526,7 @@ let findLocalCompletionsForValuesAndConstructors ~(localTables : LocalTables.t)
527526let  findLocalCompletionsForValues  ~(localTables  : LocalTables.t ) ~env   ~prefix  
528527    ~exact   ~opens   ~scope   = 
529528  localTables |>  LocalTables. populateValues ~env ;
529+   localTables |>  LocalTables. populateIncludedValues ~env ;
530530  localTables |>  LocalTables. populateModules ~env ;
531531  scope
532532  |>  Scope. iterValuesBeforeFirstOpen
0 commit comments