@@ -56,11 +56,11 @@ let rec shape_of_id env :
56
56
let rec shape_of_module_path env : _ -> Shape.t option =
57
57
let proj parent kind name =
58
58
let item = Shape.Item. make name kind in
59
- match shape_of_module_path env (parent :> Odoc_model.Paths.Path.t ) with
59
+ match shape_of_module_path env (parent :> Odoc_model.Paths.Path.Module. t ) with
60
60
| Some shape -> Some (Shape. proj shape item)
61
61
| None -> None
62
62
in
63
- fun (path : Odoc_model.Paths.Path.t ) ->
63
+ fun (path : Odoc_model.Paths.Path.Module. t ) ->
64
64
match path with
65
65
| `Resolved _ -> None
66
66
| `Root name -> (
@@ -72,11 +72,11 @@ let rec shape_of_module_path env : _ -> Shape.t option =
72
72
| _ -> None )
73
73
| `Forward _ -> None
74
74
| `Dot (parent , name ) ->
75
- proj (parent :> Odoc_model.Paths.Path.t ) Kind. Module name
75
+ proj (parent :> Odoc_model.Paths.Path.Module. t ) Kind. Module name
76
76
| `Apply (parent , arg ) ->
77
- shape_of_module_path env (parent :> Odoc_model.Paths.Path.t )
77
+ shape_of_module_path env (parent :> Odoc_model.Paths.Path.Module. t )
78
78
>> = fun parent ->
79
- shape_of_module_path env (arg :> Odoc_model.Paths.Path.t ) >> = fun arg ->
79
+ shape_of_module_path env (arg :> Odoc_model.Paths.Path.Module. t ) >> = fun arg ->
80
80
Some (Shape. app parent ~arg )
81
81
| `Identifier (id , _ ) ->
82
82
shape_of_id env (id :> Odoc_model.Paths.Identifier.NonSrc.t )
@@ -85,14 +85,14 @@ let shape_of_value_path env :
85
85
Odoc_model.Paths.Path.Value. t -> Shape. t option =
86
86
let proj parent kind name =
87
87
let item = Shape.Item. make name kind in
88
- match shape_of_module_path env ( parent :> Odoc_model.Paths.Path.t ) with
88
+ match shape_of_module_path env parent with
89
89
| Some shape -> Some (Shape. proj shape item)
90
90
| None -> None
91
91
in
92
92
fun (path : Odoc_model.Paths.Path.Value.t ) ->
93
93
match path with
94
94
| `Resolved _ -> None
95
- | `Dot (parent , name ) -> proj ( parent :> Odoc_model.Paths.Path.t ) Kind. Value name
95
+ | `Dot (parent , name ) -> proj parent Kind. Value name
96
96
| `Identifier (id , _ ) -> shape_of_id env (id :> Odoc_model.Paths.Identifier.NonSrc.t )
97
97
98
98
@@ -160,6 +160,16 @@ let lookup_value_path :
160
160
| None -> None
161
161
| Some query -> lookup_shape env query
162
162
163
+
164
+ let lookup_module_path :
165
+ Env. t ->
166
+ Path.Module. t ->
167
+ Identifier.SourceLocation. t option
168
+ = fun env path ->
169
+ match shape_of_module_path env path with
170
+ | None -> None
171
+ | Some query -> lookup_shape env query
172
+
163
173
#else
164
174
165
175
type t = unit
0 commit comments