@@ -327,8 +327,7 @@ let structure_item ~env ~extra (iter : Tast_iterator.iterator) item =
327
327
| Tstr_module {mb_expr} -> handle_module_expr ~env ~extra mb_expr.mod_desc
328
328
| Tstr_open {open_path; open_txt = {txt; loc} } ->
329
329
(* Log.log("Have an open here"); *)
330
- addForLongident ~env ~extra None open_path txt loc;
331
- Hashtbl. replace extra.opens loc ()
330
+ addForLongident ~env ~extra None open_path txt loc
332
331
| _ -> () );
333
332
Tast_iterator. default_iterator.structure_item iter item
334
333
@@ -389,36 +388,28 @@ let pat ~(file : File.t) ~env ~extra (iter : Tast_iterator.iterator)
389
388
390
389
let expr ~env ~(extra : extra ) (iter : Tast_iterator.iterator )
391
390
(expression : Typedtree.expression ) =
392
- (expression.exp_extra
393
- |> List. iter (fun (e , eloc , _ ) ->
394
- match e with
395
- | Typedtree. Texp_open (_ , _path , _ident , _ ) ->
396
- Hashtbl. add extra.opens eloc ()
397
- | _ -> () );
398
- match expression.exp_desc with
399
- | Texp_ident (path , {txt; loc} , _ ) when not (JsxHacks. pathIsFragment path) ->
400
- addForLongident ~env ~extra
401
- (Some (expression.exp_type, Value ))
402
- path txt loc
403
- | Texp_record {fields} ->
404
- addForRecord ~env ~extra ~record Type:expression.exp_type
405
- (fields |> Array. to_list
406
- |> Utils. filterMap (fun (desc , item ) ->
407
- match item with
408
- | Typedtree. Overridden (loc , _ ) -> Some (loc, desc, () )
409
- | _ -> None ))
410
- | Texp_constant constant ->
411
- addLocItem extra expression.exp_loc (Constant constant)
412
- (* Skip unit and list literals *)
413
- | Texp_construct ({txt = Lident (" ()" | " ::" ); loc}, _, _args)
414
- when loc.loc_end.pos_cnum - loc.loc_start.pos_cnum <> 2 ->
415
- ()
416
- | Texp_construct (lident , constructor , _args ) ->
417
- addForConstructor ~env ~extra expression.exp_type lident constructor
418
- | Texp_field (inner , lident , _label_description ) ->
419
- addForField ~env ~extra ~record Type:inner.exp_type
420
- ~field Type:expression.exp_type lident
421
- | _ -> () );
391
+ (match expression.exp_desc with
392
+ | Texp_ident (path , {txt; loc} , _ ) when not (JsxHacks. pathIsFragment path) ->
393
+ addForLongident ~env ~extra (Some (expression.exp_type, Value )) path txt loc
394
+ | Texp_record {fields} ->
395
+ addForRecord ~env ~extra ~record Type:expression.exp_type
396
+ (fields |> Array. to_list
397
+ |> Utils. filterMap (fun (desc , item ) ->
398
+ match item with
399
+ | Typedtree. Overridden (loc , _ ) -> Some (loc, desc, () )
400
+ | _ -> None ))
401
+ | Texp_constant constant ->
402
+ addLocItem extra expression.exp_loc (Constant constant)
403
+ (* Skip unit and list literals *)
404
+ | Texp_construct ({txt = Lident (" ()" | " ::" ); loc}, _, _args)
405
+ when loc.loc_end.pos_cnum - loc.loc_start.pos_cnum <> 2 ->
406
+ ()
407
+ | Texp_construct (lident , constructor , _args ) ->
408
+ addForConstructor ~env ~extra expression.exp_type lident constructor
409
+ | Texp_field (inner , lident , _label_description ) ->
410
+ addForField ~env ~extra ~record Type:inner.exp_type
411
+ ~field Type:expression.exp_type lident
412
+ | _ -> () );
422
413
Tast_iterator. default_iterator.expr iter expression
423
414
424
415
let getExtra ~file ~infos =
0 commit comments