Closed
Description
This rescript code:
type variant = FirstButVeryLongAndMeaninglessVariantConstructor
type t = {thisIsSomeReallyLongFieldWhichIsJustHereForDemonstration: bool}
gets extracted as:
{
"name": "MinimalExample",
"docstrings": [],
"items": [
{
"id": "MinimalExample.variant",
"kind": "type",
"name": "variant",
"signature": "type variant =\\n | FirstButVeryLongAndMeaninglessVariantConstructor", <-- HERE
"docstrings": [],
"detail":
{
"kind": "variant",
"items": [
{
"name": "FirstButVeryLongAndMeaninglessVariantConstructor",
"docstrings": [],
"signature": "FirstButVeryLongAndMeaninglessVariantConstructor"
}]
}
},
{
"id": "MinimalExample.t",
"kind": "type",
"name": "t",
"signature": "type t = {\\n thisIsSomeReallyLongFieldWhichIsJustHereForDemonstration: bool,\\n}", <-- HERE
"docstrings": [],
"detail":
{
"kind": "record",
"items": [{
"name": "thisIsSomeReallyLongFieldWhichIsJustHereForDemonstration",
"optional": false,
"docstrings": [],
"signature": "bool"
}]
}
}]
}
Note the escaped linebreaks (\\n
) in the signature.
This seems to happen, if a signature reaches some minimal length.
I would expect the line breaks to not be escaped.
edit:
I believe, this is due to calling Json.escape
.
Not sure, what's best. But I guess, it's ether not escaping those special characters or "unescaping" them, when actually parsing the json in Tools_DocGen.res?
Metadata
Metadata
Assignees
Labels
No labels