@@ -657,9 +657,7 @@ let fromCompilerPath ~(env : QueryEnv.t) path =
657
657
658
658
module F (Collector : sig
659
659
val extra : extra
660
-
661
660
val file : File .t
662
-
663
661
val scopeExtent : Location .t list ref
664
662
end ) =
665
663
struct
@@ -852,8 +850,14 @@ struct
852
850
if List. length ! Collector. scopeExtent > 1 then
853
851
Collector. scopeExtent := List. tl ! Collector. scopeExtent
854
852
853
+ let rec lidIsComplex (lid : Longident.t ) =
854
+ match lid with
855
+ | Lapply _ -> true
856
+ | Ldot (lid , _ ) -> lidIsComplex lid
857
+ | _ -> false
858
+
855
859
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 (
857
861
let idLength =
858
862
String. length (String. concat " ." (Longident. flatten txt))
859
863
in
@@ -879,7 +883,8 @@ struct
879
883
match expr with
880
884
| Tmod_constraint (expr , _ , _ , _ ) -> handle_module_expr expr.mod_desc
881
885
| 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));
883
888
addForLongident None path txt loc
884
889
| Tmod_functor (_ident , _argName , _maybeType , resultExpr ) ->
885
890
handle_module_expr resultExpr.mod_desc
@@ -1052,9 +1057,7 @@ let extraForStructureItems ~(file : File.t)
1052
1057
(* TODO look through parts and extend the extent *)
1053
1058
let module Iter = TypedtreeIter. MakeIterator (F (struct
1054
1059
let scopeExtent = ref [extent]
1055
-
1056
1060
let extra = extra
1057
-
1058
1061
let file = file
1059
1062
end )) in
1060
1063
List. iter Iter. iter_structure_item items;
@@ -1089,9 +1092,7 @@ let extraForSignatureItems ~(file : File.t)
1089
1092
(* TODO look through parts and extend the extent *)
1090
1093
let module Iter = TypedtreeIter. MakeIterator (F (struct
1091
1094
let scopeExtent = ref [extent]
1092
-
1093
1095
let extra = extra
1094
-
1095
1096
let file = file
1096
1097
end )) in
1097
1098
List. iter Iter. iter_signature_item items;
0 commit comments