Skip to content

Commit 9aa8e0f

Browse files
aspeddrozth
authored andcommitted
add module name field (#819)
1 parent c636096 commit 9aa8e0f

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

analysis/src/DocExtraction.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ let rec stringifyDocItem ?(indentation = 0) ~originalEnv (item : docItem) =
154154
stringifyObject ~startOnNewline:true ~indentation
155155
[
156156
("id", Some (wrapInQuotes m.id));
157+
("name", Some (wrapInQuotes m.name));
157158
("kind", Some (wrapInQuotes "module"));
158159
( "item",
159160
Some
@@ -165,6 +166,7 @@ let rec stringifyDocItem ?(indentation = 0) ~originalEnv (item : docItem) =
165166
[
166167
("id", Some (wrapInQuotes m.id));
167168
("kind", Some (wrapInQuotes "moduleAlias"));
169+
("name", Some (wrapInQuotes m.name));
168170
("docstrings", Some (stringifyDocstrings m.docstring));
169171
("signature", Some (m.signature |> Json.escape |> wrapInQuotes));
170172
]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ preferring found resi file for impl: src/DocExtraction2.resi
2222
},
2323
{
2424
"id": "InnerModule.DocExtraction2",
25+
"name": "InnerModule",
2526
"kind": "module",
2627
"item":
2728
{

analysis/tests/src/expected/DocExtraction2.resi.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extracting docs for src/DocExtraction2.resi
2121
},
2222
{
2323
"id": "InnerModule.DocExtraction2",
24+
"name": "InnerModule",
2425
"kind": "module",
2526
"item":
2627
{

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ extracting docs for src/DocExtractionRes.res
4343
},
4444
{
4545
"id": "SomeInnerModule.DocExtractionRes",
46+
"name": "SomeInnerModule",
4647
"kind": "module",
4748
"item":
4849
{
@@ -94,6 +95,7 @@ extracting docs for src/DocExtractionRes.res
9495
},
9596
{
9697
"id": "AnotherModule.DocExtractionRes",
98+
"name": "AnotherModule",
9799
"kind": "module",
98100
"item":
99101
{
@@ -103,6 +105,7 @@ extracting docs for src/DocExtractionRes.res
103105
{
104106
"id": "DocExtractionRes.AnotherModule.SomeInnerModule",
105107
"kind": "moduleAlias",
108+
"name": "LinkedModule",
106109
"docstrings": ["This links another module. Neat."],
107110
"signature": "module LinkedModule = SomeInnerModule"
108111
},
@@ -148,6 +151,7 @@ extracting docs for src/DocExtractionRes.res
148151
},
149152
{
150153
"id": "ModuleWithThingsThatShouldNotBeExported.DocExtractionRes",
154+
"name": "ModuleWithThingsThatShouldNotBeExported",
151155
"kind": "module",
152156
"item":
153157
{

0 commit comments

Comments
 (0)