Skip to content

Commit 97e1dae

Browse files
committed
Sherlodoc
1 parent 0e57a5b commit 97e1dae

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

sherlodoc/index/load_doc.ml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ let searchable_type_of_constructor args res =
8181
match args with
8282
| TypeDecl.Constructor.Tuple args -> begin
8383
match args with
84-
| _ :: _ :: _ -> TypeExpr.(Arrow (None, Tuple args, res))
84+
| _ :: _ :: _ -> TypeExpr.(Arrow (None, Tuple (List.map (fun x -> (None, x)) args), res))
8585
| [ arg ] -> TypeExpr.(Arrow (None, arg, res))
8686
| _ -> res
8787
end
@@ -119,6 +119,10 @@ let convert_kind ~db (Odoc_index.Entry.{ kind; _ } as entry) =
119119
let typ = searchable_type_of_record parent_type type_ in
120120
let typ = Db_writer.type_of_odoc ~db typ in
121121
Entry.Kind.Field typ
122+
| UnboxedField { mutable_ = _; parent_type; type_ } ->
123+
let typ = searchable_type_of_record parent_type type_ in
124+
let typ = Db_writer.type_of_odoc ~db typ in
125+
Entry.Kind.Field typ
122126
| Doc -> Doc
123127
| Dir -> Doc
124128
| Page _ -> Doc
@@ -146,7 +150,7 @@ let rec categorize id =
146150
| `Root _ | `Page _ | `LeafPage _ -> `definition
147151
| `ModuleType _ -> `declaration
148152
| `Parameter _ -> `ignore (* redundant with indexed signature *)
149-
| ( `InstanceVariable _ | `Method _ | `Field _ | `Result _ | `Label _ | `Type _
153+
| ( `InstanceVariable _ | `Method _ | `Field _ | `UnboxedField _ | `Result _ | `Label _ | `Type _
150154
| `Exception _ | `Class _ | `ClassType _ | `Value _ | `Constructor _ | `Extension _
151155
| `ExtensionDecl _ | `Module _ ) as x ->
152156
let parent = Identifier.label_parent { id with iv = x } in

sherlodoc/index/type_cache.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ let rec of_odoc ~cache otyp =
1919
| Arrow (_lbl, left, right) -> cache (Arrow (of_odoc ~cache left, of_odoc ~cache right))
2020
| Constr (name, args) ->
2121
cache (Constr (Typename.to_string name, List.map (of_odoc ~cache) args))
22-
| Tuple li -> cache (Tuple (List.map (of_odoc ~cache) li))
22+
| Tuple li -> cache (Tuple (List.map (fun (_, x) -> of_odoc ~cache x) li))
2323
| _ -> Unhandled

0 commit comments

Comments
 (0)