@@ -981,10 +981,8 @@ let getIterator (extra : extra) (file : File.t) =
981
981
typ;
982
982
}
983
983
984
- let extraForStructureItems ~(file : File.t )
984
+ let extraForStructureItems ~(iterator : Tast_iterator.iterator )
985
985
(items : Typedtree.structure_item list ) parts =
986
- let extra = extraForFile ~file in
987
- let iterator = getIterator extra file in
988
986
items |> List. iter (iterator.structure_item iterator);
989
987
990
988
(* Log.log("Parts " ++ string_of_int(Array.length(parts))); *)
@@ -998,13 +996,10 @@ let extraForStructureItems ~(file : File.t)
998
996
| Partial_class_expr () -> ()
999
997
| Partial_module_type module_type ->
1000
998
iterator.module_type iterator module_type
1001
- | Partial_structure _ | Partial_structure_item _ -> () );
1002
- extra
999
+ | Partial_structure _ | Partial_structure_item _ -> () )
1003
1000
1004
- let extraForSignatureItems ~(file : File.t )
1001
+ let extraForSignatureItems ~(iterator : Tast_iterator.iterator )
1005
1002
(items : Typedtree.signature_item list ) parts =
1006
- let extra = extraForFile ~file in
1007
- let iterator = getIterator extra file in
1008
1003
items |> List. iter (iterator.signature_item iterator);
1009
1004
(* Log.log("Parts " ++ string_of_int(Array.length(parts))); *)
1010
1005
parts
@@ -1017,13 +1012,12 @@ let extraForSignatureItems ~(file : File.t)
1017
1012
| Partial_class_expr () -> ()
1018
1013
| Partial_module_type module_type ->
1019
1014
iterator.module_type iterator module_type
1020
- | Partial_structure _ | Partial_structure_item _ -> () );
1021
- extra
1015
+ | Partial_structure _ | Partial_structure_item _ -> () )
1022
1016
1023
- let extraForCmt ~file ({cmt_annots} : Cmt_format.cmt_infos ) =
1017
+ let extraForCmt ~iterator ({cmt_annots} : Cmt_format.cmt_infos ) =
1024
1018
match cmt_annots with
1025
1019
| Implementation structure ->
1026
- extraForStructureItems ~file structure.str_items [||]
1020
+ extraForStructureItems ~iterator structure.str_items [||]
1027
1021
| Partial_implementation parts ->
1028
1022
let items =
1029
1023
parts |> Array. to_list
@@ -1035,8 +1029,9 @@ let extraForCmt ~file ({cmt_annots} : Cmt_format.cmt_infos) =
1035
1029
| _ -> None )
1036
1030
|> List. concat
1037
1031
in
1038
- extraForStructureItems ~file items parts
1039
- | Interface signature -> extraForSignatureItems ~file signature.sig_items [||]
1032
+ extraForStructureItems ~iterator items parts
1033
+ | Interface signature ->
1034
+ extraForSignatureItems ~iterator signature.sig_items [||]
1040
1035
| Partial_interface parts ->
1041
1036
let items =
1042
1037
parts |> Array. to_list
@@ -1047,15 +1042,17 @@ let extraForCmt ~file ({cmt_annots} : Cmt_format.cmt_infos) =
1047
1042
| _ -> None )
1048
1043
|> List. concat
1049
1044
in
1050
- extraForSignatureItems ~file items parts
1051
- | _ -> extraForStructureItems ~file [] [||]
1045
+ extraForSignatureItems ~iterator items parts
1046
+ | _ -> extraForStructureItems ~iterator [] [||]
1052
1047
1053
1048
let fullForCmt ~moduleName ~package ~uri cmt =
1054
1049
match Shared. tryReadCmt cmt with
1055
1050
| None -> None
1056
1051
| Some infos ->
1057
1052
let file = forCmt ~module Name ~uri infos in
1058
- let extra = extraForCmt ~file infos in
1053
+ let extra = extraForFile ~file in
1054
+ let iterator = getIterator extra file in
1055
+ extraForCmt ~iterator infos;
1059
1056
Some {file; extra; package}
1060
1057
1061
1058
open SharedTypes
0 commit comments