File tree Expand file tree Collapse file tree 6 files changed +70
-2
lines changed Expand file tree Collapse file tree 6 files changed +70
-2
lines changed Original file line number Diff line number Diff line change 1212
1313## master
1414
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+
1520## 0.4.0
1621
1722#### :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) =
172172 (" id" , Some (wrapInQuotes m.id));
173173 (" name" , Some (wrapInQuotes m.name));
174174 (" kind" , Some (wrapInQuotes " module" ));
175+ ( " deprecated" ,
176+ match m.deprecated with
177+ | Some d -> Some (wrapInQuotes d)
178+ | None -> None );
175179 (" docstrings" , Some (stringifyDocstrings m.docstring));
176180 ( " items" ,
177181 Some
@@ -353,10 +357,17 @@ let extractDocs ~path ~debug =
353357 })
354358 | Module (Structure m ) ->
355359 (* module Whatever = {} in res or module Whatever: {} in resi. *)
360+ let modulePath = m.name :: modulePath in
361+ let docs = extractDocsForModule ~module Path m in
356362 Some
357363 (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+ })
360371 | Module
361372 (Constraint (Structure _impl, Structure interface)) ->
362373 (* 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