Skip to content

Commit cc20325

Browse files
committed
[src][state][loc_dep][3/n] stop exploring includes
1 parent 32ecd95 commit cc20325

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

src/state/location_dependencies.ml

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,6 @@ module UidTbl = Shape.Uid.Tbl
66

77
type uid_to_decl = Typedtree.item_declaration UidTbl.t
88

9-
let fill_from_structure (structure : Typedtree.structure) res_uid_to_loc =
10-
let open Types in
11-
let rec fill_from_signature_item = function
12-
| Sig_value (_, {val_loc; val_uid; _}, _) ->
13-
UidTbl.replace res_uid_to_loc val_uid val_loc.loc_start
14-
| Sig_module (_, _, {md_type = modtype; _}, _, _)
15-
| Sig_modtype (_, {mtd_type = Some modtype; _}, _) ->
16-
Utils.signature_of_modtype modtype
17-
|> fill_from_signature
18-
| _ -> ()
19-
and fill_from_signature s =
20-
List.iter fill_from_signature_item s
21-
in
22-
let iterator =
23-
let super = Tast_iterator.default_iterator in
24-
let structure_item self struct_item =
25-
let open Typedtree in
26-
begin match struct_item.str_desc with
27-
| Tstr_include {incl_type; _} -> fill_from_signature incl_type
28-
| _ -> ()
29-
end;
30-
super.Tast_iterator.structure_item self struct_item
31-
in
32-
{super with structure_item}
33-
in
34-
iterator.structure iterator structure;
35-
res_uid_to_loc
36-
379
let loc_opt_of_item_decl = function
3810
| Typedtree.Value {val_loc = loc; _}
3911
| Typedtree.Value_binding {vb_pat = {pat_loc = loc; _}; _} ->
@@ -92,7 +64,7 @@ let cmt_decl_dep_to_loc_dep ~cm_paths cmt_decl_dep uid_to_loc =
9264

9365
let init ~cm_paths cmt_infos cmti_uid_to_decl =
9466
match cmt_infos.Cmt_format.cmt_annots with
95-
| Implementation structure ->
67+
| Implementation _ ->
9668
let fill_from_cmti_tbl tbl =
9769
match cmti_uid_to_decl with
9870
| None -> tbl
@@ -101,7 +73,6 @@ let init ~cm_paths cmt_infos cmti_uid_to_decl =
10173
in
10274
(* TODO: Evaluate a generally good size for the tbl ? *)
10375
UidTbl.create 512
104-
|> fill_from_structure structure
10576
|> fill_from_cmt_tbl cmt_infos.cmt_uid_to_decl
10677
|> fill_from_cmti_tbl
10778
|> cmt_decl_dep_to_loc_dep ~cm_paths cmt_infos.cmt_declaration_dependencies

0 commit comments

Comments
 (0)