Skip to content

Commit 73cdd3e

Browse files
committed
field name, and fix double escaping
1 parent 029e28c commit 73cdd3e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

analysis/src/DocExtraction.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ end
129129
let stringifyDocstrings docstrings =
130130
let open Protocol in
131131
docstrings
132-
|> List.map (fun docstring ->
133-
docstring |> String.trim |> Json.escape |> wrapInQuotes)
132+
|> List.map (fun docstring -> docstring |> String.trim |> wrapInQuotes)
134133
|> array
135134

136135
let stringifyLinkables ?(indentation = 0)
@@ -181,7 +180,7 @@ let stringifyDetail ?(indentation = 0) ~originalEnv (detail : docItemDetail) =
181180
stringifyObject ~startOnNewline:true ~indentation
182181
[
183182
("kind", Some (wrapInQuotes "variant"));
184-
( "fieldDocs",
183+
( "constructorDocs",
185184
Some
186185
(constructorDocs
187186
|> List.map (fun constructorDoc ->

analysis/tests/src/expected/DocExtractionRes.res.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extracting docs for src/DocExtractionRes.res
3333
"kind": "value",
3434
"name": "make",
3535
"signature": "let make: string => t",
36-
"docstrings": ["Create stuff.\\n\\n```rescript example\\nlet stuff = make(\\\"My name\\\")\\n```"],
36+
"docstrings": ["Create stuff.\n\n```rescript example\nlet stuff = make(\"My name\")\n```"],
3737
"linkables": [{
3838
"linkId": "DocExtractionRes.t",
3939
"name": "t",
@@ -74,7 +74,7 @@ extracting docs for src/DocExtractionRes.res
7474
"detail":
7575
{
7676
"kind": "variant",
77-
"fieldDocs": [
77+
"constructorDocs": [
7878
{
7979
"constructorName": "Started",
8080
"docstrings": ["If this is started or not"],
@@ -167,7 +167,7 @@ extracting docs for src/DocExtractionRes.res
167167
"detail":
168168
{
169169
"kind": "variant",
170-
"fieldDocs": [
170+
"constructorDocs": [
171171
{
172172
"constructorName": "SomeStuff",
173173
"docstrings": ["This has inline records..."],

0 commit comments

Comments
 (0)