Skip to content

[DocGen]: add module name field #819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions analysis/src/DocExtraction.ml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ let rec stringifyDocItem ?(indentation = 0) ~originalEnv (item : docItem) =
stringifyObject ~startOnNewline:true ~indentation
[
("id", Some (wrapInQuotes m.id));
("name", Some (wrapInQuotes m.name));
("kind", Some (wrapInQuotes "module"));
( "item",
Some
Expand All @@ -138,6 +139,7 @@ let rec stringifyDocItem ?(indentation = 0) ~originalEnv (item : docItem) =
[
("id", Some (wrapInQuotes m.id));
("kind", Some (wrapInQuotes "moduleAlias"));
("name", Some (wrapInQuotes m.name));
("docstrings", Some (stringifyDocstrings m.docstring));
("signature", Some (m.signature |> Json.escape |> wrapInQuotes));
]
Expand Down
1 change: 1 addition & 0 deletions analysis/tests/src/expected/DocExtraction2.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ preferring found resi file for impl: src/DocExtraction2.resi
},
{
"id": "InnerModule.DocExtraction2",
"name": "InnerModule",
"kind": "module",
"item":
{
Expand Down
1 change: 1 addition & 0 deletions analysis/tests/src/expected/DocExtraction2.resi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ extracting docs for src/DocExtraction2.resi
},
{
"id": "InnerModule.DocExtraction2",
"name": "InnerModule",
"kind": "module",
"item":
{
Expand Down
4 changes: 4 additions & 0 deletions analysis/tests/src/expected/DocExtractionRes.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ extracting docs for src/DocExtractionRes.res
},
{
"id": "SomeInnerModule.DocExtractionRes",
"name": "SomeInnerModule",
"kind": "module",
"item":
{
Expand Down Expand Up @@ -92,6 +93,7 @@ extracting docs for src/DocExtractionRes.res
},
{
"id": "AnotherModule.DocExtractionRes",
"name": "AnotherModule",
"kind": "module",
"item":
{
Expand All @@ -101,6 +103,7 @@ extracting docs for src/DocExtractionRes.res
{
"id": "DocExtractionRes.AnotherModule.SomeInnerModule",
"kind": "moduleAlias",
"name": "LinkedModule",
"docstrings": ["This links another module. Neat."],
"signature": "module LinkedModule = SomeInnerModule"
},
Expand Down Expand Up @@ -146,6 +149,7 @@ extracting docs for src/DocExtractionRes.res
},
{
"id": "ModuleWithThingsThatShouldNotBeExported.DocExtractionRes",
"name": "ModuleWithThingsThatShouldNotBeExported",
"kind": "module",
"item":
{
Expand Down