@@ -657,9 +657,7 @@ let fromCompilerPath ~(env : QueryEnv.t) path =
657657
658658module F (Collector : sig
659659 val extra : extra
660-
661660 val file : File .t
662-
663661 val scopeExtent : Location .t list ref
664662end ) =
665663struct
@@ -852,8 +850,14 @@ struct
852850 if List. length ! Collector. scopeExtent > 1 then
853851 Collector. scopeExtent := List. tl ! Collector. scopeExtent
854852
853+ let rec lidIsComplex (lid : Longident.t ) =
854+ match lid with
855+ | Lapply _ -> true
856+ | Ldot (lid , _ ) -> lidIsComplex lid
857+ | _ -> false
858+
855859 let rec addForLongident top (path : Path.t ) (txt : Longident.t ) loc =
856- if not loc.Location. loc_ghost then (
860+ if ( not loc.Location. loc_ghost) && not (lidIsComplex txt) then (
857861 let idLength =
858862 String. length (String. concat " ." (Longident. flatten txt))
859863 in
@@ -879,7 +883,8 @@ struct
879883 match expr with
880884 | Tmod_constraint (expr , _ , _ , _ ) -> handle_module_expr expr.mod_desc
881885 | Tmod_ident (path , {txt; loc} ) ->
882- Log. log (" Ident!! " ^ String. concat " ." (Longident. flatten txt));
886+ if not (lidIsComplex txt) then
887+ Log. log (" Ident!! " ^ String. concat " ." (Longident. flatten txt));
883888 addForLongident None path txt loc
884889 | Tmod_functor (_ident , _argName , _maybeType , resultExpr ) ->
885890 handle_module_expr resultExpr.mod_desc
@@ -1052,9 +1057,7 @@ let extraForStructureItems ~(file : File.t)
10521057 (* TODO look through parts and extend the extent *)
10531058 let module Iter = TypedtreeIter. MakeIterator (F (struct
10541059 let scopeExtent = ref [extent]
1055-
10561060 let extra = extra
1057-
10581061 let file = file
10591062 end )) in
10601063 List. iter Iter. iter_structure_item items;
@@ -1089,9 +1092,7 @@ let extraForSignatureItems ~(file : File.t)
10891092 (* TODO look through parts and extend the extent *)
10901093 let module Iter = TypedtreeIter. MakeIterator (F (struct
10911094 let scopeExtent = ref [extent]
1092-
10931095 let extra = extra
1094-
10951096 let file = file
10961097 end )) in
10971098 List. iter Iter. iter_signature_item items;
0 commit comments