|
@@ -35,7 +35,7 @@ let get_submodule_fields ctx path =
|
|
|
) tl in
|
|
|
tl
|
|
|
|
|
|
-let collect_static_extensions ctx items e p =
|
|
|
+let collect_static_extensions ctx blocked_items items e p =
|
|
|
let opt_type t =
|
|
|
match t with
|
|
|
| TLazy f ->
|
|
@@ -81,7 +81,13 @@ let collect_static_extensions ctx items e p =
|
|
|
end
|
|
|
| _ ->
|
|
|
acc
|
|
|
- in
|
|
|
+ in
|
|
|
+ let handle_field c cf acc =
|
|
|
+ if Hashtbl.mem blocked_items cf.cf_name then
|
|
|
+ acc
|
|
|
+ else
|
|
|
+ handle_field c cf acc
|
|
|
+ in
|
|
|
let rec loop acc = function
|
|
|
| [] ->
|
|
|
acc
|
|
@@ -142,6 +148,17 @@ let collect ctx e_ast e dk with_type p =
|
|
|
let ct = CompletionType.from_type (get_import_status ctx) ~values:(get_value_meta cf.cf_meta) cf.cf_type in
|
|
|
make_ci_class_field (CompletionClassField.make cf CFSMember origin true) (cf.cf_type,ct)
|
|
|
in
|
|
|
+ let blocked_items = Hashtbl.create 0 in
|
|
|
+ let should_access c cf stat =
|
|
|
+ if Hashtbl.mem blocked_items cf.cf_name then
|
|
|
+ false
|
|
|
+ else if should_access c cf stat then
|
|
|
+ true
|
|
|
+ else begin
|
|
|
+ Hashtbl.add blocked_items cf.cf_name ();
|
|
|
+ false
|
|
|
+ end
|
|
|
+ in
|
|
|
let rec loop items t =
|
|
|
let is_new_item items name = not (PMap.mem name items) in
|
|
|
let rec browse_interfaces c acc =
|
|
@@ -345,7 +362,7 @@ let collect ctx e_ast e dk with_type p =
|
|
|
(* Collect fields of the type *)
|
|
|
let items = loop items e.etype in
|
|
|
(* Add static extensions *)
|
|
|
- let items = collect_static_extensions ctx items e p in
|
|
|
+ let items = collect_static_extensions ctx blocked_items items e p in
|
|
|
let items = PMap.fold (fun item acc -> item :: acc) items [] in
|
|
|
let items = sort_fields items WithType.value (TKField p) in
|
|
|
try
|