File tree 6 files changed +70
-2
lines changed
6 files changed +70
-2
lines changed Original file line number Diff line number Diff line change 12
12
13
13
## master
14
14
15
+ #### :bug : Bug Fix
16
+
17
+ - Print docstrings for nested submodules. https://github.com/rescript-lang/rescript-vscode/pull/897
18
+ - Print ` deprecated ` field for module. https://github.com/rescript-lang/rescript-vscode/pull/897
19
+
15
20
## 0.4.0
16
21
17
22
#### :bug : Bug Fix
Original file line number Diff line number Diff line change @@ -172,6 +172,10 @@ let rec stringifyDocItem ?(indentation = 0) ~originalEnv (item : docItem) =
172
172
(" id" , Some (wrapInQuotes m.id));
173
173
(" name" , Some (wrapInQuotes m.name));
174
174
(" kind" , Some (wrapInQuotes " module" ));
175
+ ( " deprecated" ,
176
+ match m.deprecated with
177
+ | Some d -> Some (wrapInQuotes d)
178
+ | None -> None );
175
179
(" docstrings" , Some (stringifyDocstrings m.docstring));
176
180
( " items" ,
177
181
Some
@@ -353,10 +357,17 @@ let extractDocs ~path ~debug =
353
357
})
354
358
| Module (Structure m ) ->
355
359
(* module Whatever = {} in res or module Whatever: {} in resi. *)
360
+ let modulePath = m.name :: modulePath in
361
+ let docs = extractDocsForModule ~module Path m in
356
362
Some
357
363
(Module
358
- (extractDocsForModule
359
- ~module Path:(m.name :: modulePath) m))
364
+ {
365
+ id = modulePath |> List. rev |> ident;
366
+ name = m.name;
367
+ docstring = item.docstring @ m.docstring;
368
+ deprecated = item.deprecated;
369
+ items = docs.items;
370
+ })
360
371
| Module
361
372
(Constraint (Structure _impl, Structure interface)) ->
362
373
(* module Whatever: { <interface> } = { <impl> }. Prefer the interface. *)
Original file line number Diff line number Diff line change
1
+ /**
2
+ User Module
3
+ */
4
+ module User = {
5
+ let name = "ReScript"
6
+ }
Original file line number Diff line number Diff line change
1
+ /**
2
+ User Module from interface file
3
+ */
4
+ module User: {
5
+ let name: string
6
+ }
Original file line number Diff line number Diff line change
1
+
2
+ {
3
+ "name" : " ModC" ,
4
+ "docstrings" : [],
5
+ "items" : [
6
+ {
7
+ "id" : " ModC.User" ,
8
+ "name" : " User" ,
9
+ "kind" : " module" ,
10
+ "docstrings" : [" User Module from interface file" ],
11
+ "items" : [
12
+ {
13
+ "id" : " ModC.User.name" ,
14
+ "kind" : " value" ,
15
+ "name" : " name" ,
16
+ "signature" : " let name: string" ,
17
+ "docstrings" : []
18
+ }]
19
+ }]
20
+ }
Original file line number Diff line number Diff line change
1
+
2
+ {
3
+ "name" : " ModC" ,
4
+ "docstrings" : [],
5
+ "items" : [
6
+ {
7
+ "id" : " ModC.User" ,
8
+ "name" : " User" ,
9
+ "kind" : " module" ,
10
+ "docstrings" : [" User Module from interface file" ],
11
+ "items" : [
12
+ {
13
+ "id" : " ModC.User.name" ,
14
+ "kind" : " value" ,
15
+ "name" : " name" ,
16
+ "signature" : " let name: string" ,
17
+ "docstrings" : []
18
+ }]
19
+ }]
20
+ }
You can’t perform that action at this time.
0 commit comments