@@ -185,20 +185,20 @@ let constructor_path :
185
185
(* else *)
186
186
if not (should_resolve_constructor p) then p
187
187
else
188
- let cp = Component.Of_Lang. (constructor_path (empty () ) p) in
189
- match cp with
190
- | `Resolved p ->
191
- let result = Tools. reresolve_constructor env p in
192
- `Resolved Lang_of. (Path. resolved_constructor (empty () ) result)
193
- | _ -> (
194
- match Tools. resolve_constructor_path env cp with
195
- | Ok p' ->
196
- let result = Tools. reresolve_constructor env p' in
197
- `Resolved Lang_of. (Path. resolved_constructor (empty () ) result)
198
- | Error e ->
199
- if report_errors then
200
- Errors. report ~what: (`Constructor_path cp) ~tools_error: e `Lookup ;
201
- p)
188
+ let cp = Component.Of_Lang. (constructor_path (empty () ) p) in
189
+ match cp with
190
+ | `Resolved p ->
191
+ let result = Tools. reresolve_constructor env p in
192
+ `Resolved Lang_of. (Path. resolved_constructor (empty () ) result)
193
+ | _ -> (
194
+ match Tools. resolve_constructor_path env cp with
195
+ | Ok p' ->
196
+ let result = Tools. reresolve_constructor env p' in
197
+ `Resolved Lang_of. (Path. resolved_constructor (empty () ) result)
198
+ | Error e ->
199
+ if report_errors then
200
+ Errors. report ~what: (`Constructor_path cp) ~tools_error: e `Lookup ;
201
+ p)
202
202
203
203
let class_type_path :
204
204
?report_errors :bool ->
@@ -427,6 +427,11 @@ let rec unit env t =
427
427
| Pack _ as p -> p
428
428
in
429
429
let source_info =
430
+ let env =
431
+ match t.content with
432
+ | Module sg -> Env. open_signature sg env |> Env. add_docs sg.doc
433
+ | Pack _ -> env
434
+ in
430
435
let open Source_info in
431
436
match t.source_info with
432
437
| Some inf ->
@@ -455,14 +460,25 @@ let rec unit env t =
455
460
(Shape_tools. lookup_value_path env)
456
461
(value_path ~report_errors: false env))
457
462
| Module v ->
458
- Module (jump_to v (fun _ -> None ) (module_path ~report_errors: false env))
463
+ Module
464
+ (jump_to v
465
+ (fun _ -> None )
466
+ (module_path ~report_errors: false env))
459
467
| ModuleType v ->
460
468
ModuleType
461
- (jump_to v (fun _ -> None ) (module_type_path ~report_errors: false env))
462
- | Type v -> Type (jump_to v (fun _ -> None ) (type_path ~report_errors: false env))
469
+ (jump_to v
470
+ (fun _ -> None )
471
+ (module_type_path ~report_errors: false env))
472
+ | Type v ->
473
+ Type
474
+ (jump_to v
475
+ (fun _ -> None )
476
+ (type_path ~report_errors: false env))
463
477
| Constructor v ->
464
478
Constructor
465
- (jump_to v (fun _ -> None ) (constructor_path ~report_errors: false env))
479
+ (jump_to v
480
+ (fun _ -> None )
481
+ (constructor_path ~report_errors: false env))
466
482
| i -> i
467
483
in
468
484
(info, pos))
0 commit comments