File tree Expand file tree Collapse file tree 2 files changed +3
-16
lines changed
Expand file tree Collapse file tree 2 files changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,6 @@ and docsForModule = {
4848 items : docItem list ;
4949}
5050
51- let formatCode content =
52- let {Res_driver. parsetree = signature; comments} =
53- Res_driver. parseInterfaceFromSource ~for Printer:true
54- ~display Filename:" <missing-file>" ~source: content
55- in
56- Res_printer. printInterface ~width: ! Res_cli.ResClflags. width ~comments
57- signature
58- |> String. trim
59-
6051let stringifyDocstrings docstrings =
6152 let open Protocol in
6253 docstrings
@@ -282,8 +273,7 @@ let extractDocs ~path ~debug =
282273 id = modulePath |> makeId ~identifier: item.name;
283274 docstring = item.docstring |> List. map String. trim;
284275 signature =
285- " let " ^ item.name ^ " : " ^ Shared. typeToString typ
286- |> formatCode;
276+ " let " ^ item.name ^ " : " ^ Shared. typeToString typ;
287277 name = item.name;
288278 deprecated = item.deprecated;
289279 })
@@ -293,10 +283,7 @@ let extractDocs ~path ~debug =
293283 {
294284 id = modulePath |> makeId ~identifier: item.name;
295285 docstring = item.docstring |> List. map String. trim;
296- signature =
297- typ.decl
298- |> Shared. declToString item.name
299- |> formatCode;
286+ signature = typ.decl |> Shared. declToString item.name;
300287 name = item.name;
301288 deprecated = item.deprecated;
302289 detail = typeDetail typ ~full ~env ;
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ extracting docs for src/DocExtractionRes.res
118118 "id": "DocExtractionRes.AnotherModule.someVariantWithInlineRecords",
119119 "kind": "type",
120120 "name": "someVariantWithInlineRecords",
121- "signature": "type someVariantWithInlineRecords = SomeStuff({offline: bool})",
121+ "signature": "type someVariantWithInlineRecords =\\n | SomeStuff({offline: bool})",
122122 "docstrings": ["Trying how it looks with an inline record in a variant."],
123123 "detail":
124124 {
You can’t perform that action at this time.
0 commit comments