@@ -53,14 +53,17 @@ let get_class_field_desc_infos = function
5353 | Typedtree. Tcf_method (str_loc , _ , _ ) -> Some (str_loc, `Method )
5454 | _ -> None
5555
56- let outline_type ~env typ =
57- let ppf, to_string = Format. to_string () in
58- Printtyp. wrap_printing_env env (fun () ->
59- Type_utils. print_type_with_decl ~verbosity: (Mconfig.Verbosity. Lvl 0 ) env
60- ppf typ);
61- Some (to_string () )
62-
63- let rec summarize node =
56+ let outline_type ~include_types ~env typ =
57+ match include_types with
58+ | true ->
59+ let ppf, to_string = Format. to_string () in
60+ Printtyp. wrap_printing_env env (fun () ->
61+ Type_utils. print_type_with_decl ~verbosity: (Mconfig.Verbosity. Lvl 0 ) env
62+ ppf typ);
63+ Some (to_string () )
64+ | false -> None
65+
66+ let rec summarize ~include_types node =
6467 let location = node.t_loc in
6568 match node.t_node with
6669 | Value_binding vb ->
@@ -69,15 +72,15 @@ let rec summarize node =
6972 match id_of_patt vb.vb_pat with
7073 | None -> None
7174 | Some ident ->
72- let typ = outline_type ~env: node.t_env vb.vb_pat.pat_type in
75+ let typ = outline_type ~include_types ~ env: node.t_env vb.vb_pat.pat_type in
7376 Some (mk ~location ~deprecated `Value typ ident)
7477 end
7578 | Value_description vd ->
7679 let deprecated = Type_utils. is_deprecated vd.val_attributes in
77- let typ = outline_type ~env: node.t_env vd.val_val.val_type in
80+ let typ = outline_type ~include_types ~ env: node.t_env vd.val_val.val_type in
7881 Some (mk ~location ~deprecated `Value typ vd.val_id)
7982 | Module_declaration md ->
80- let children = get_mod_children node in
83+ let children = get_mod_children ~include_types node in
8184 begin
8285 match md.md_id with
8386 | None -> None
@@ -86,7 +89,7 @@ let rec summarize node =
8689 Some (mk ~children ~location ~deprecated `Module None id)
8790 end
8891 | Module_binding mb ->
89- let children = get_mod_children node in
92+ let children = get_mod_children ~include_types node in
9093 begin
9194 match mb.mb_id with
9295 | None -> None
@@ -95,7 +98,7 @@ let rec summarize node =
9598 Some (mk ~children ~location ~deprecated `Module None id)
9699 end
97100 | Module_type_declaration mtd ->
98- let children = get_mod_children node in
101+ let children = get_mod_children ~include_types node in
99102 let deprecated = Type_utils. is_deprecated mtd.mtd_attributes in
100103 Some (mk ~deprecated ~children ~location `Modtype None mtd.mtd_id)
101104 | Type_declaration td ->
@@ -120,7 +123,7 @@ let rec summarize node =
120123 let name = Path. name te.tyext_path in
121124 let children =
122125 List. filter_map (Lazy. force node.t_children) ~f: (fun x ->
123- summarize x >> | fun x ->
126+ summarize ~include_types x >> | fun x ->
124127 { x with Query_protocol. outline_kind = `Constructor })
125128 in
126129 let deprecated = Type_utils. is_deprecated te.tyext_attributes in
@@ -167,24 +170,25 @@ and get_class_elements node =
167170 | _ -> None )
168171 | _ -> []
169172
170- and get_mod_children node =
171- List. concat_map (Lazy. force node.t_children) ~f: remove_mod_indir
173+ and get_mod_children ~ include_types node =
174+ List. concat_map (Lazy. force node.t_children) ~f: ( remove_mod_indir ~include_types )
172175
173- and remove_mod_indir node =
176+ and remove_mod_indir ~ include_types node =
174177 match node.t_node with
175178 | Module_expr _ | Module_type _ ->
176- List. concat_map (Lazy. force node.t_children) ~f: remove_mod_indir
177- | _ -> remove_top_indir node
179+ List. concat_map (Lazy. force node.t_children) ~f: ( remove_mod_indir ~include_types )
180+ | _ -> remove_top_indir ~include_types node
178181
179- and remove_top_indir t =
182+ and remove_top_indir ~ include_types t =
180183 match t.t_node with
181184 | Structure _ | Signature _ ->
182- List. concat_map ~f: remove_top_indir (Lazy. force t.t_children)
185+ List. concat_map ~f: ( remove_top_indir ~include_types ) (Lazy. force t.t_children)
183186 | Signature_item _ | Structure_item _ ->
184- List. filter_map (Lazy. force t.t_children) ~f: summarize
187+ List. filter_map (Lazy. force t.t_children) ~f: ( summarize ~include_types )
185188 | _ -> []
186189
187- let get browses = List. concat @@ List. rev_map ~f: remove_top_indir browses
190+ let get ~include_types browses =
191+ List. concat @@ List. rev_map ~f: (remove_top_indir ~include_types ) browses
188192
189193let shape cursor nodes =
190194 let rec aux node =
0 commit comments