Closed woeps closed 2 months ago
Once #1009 is implemented, I think we should include the annotated module type in the generated json:
// Example.res module type MT = { let x: int } module M: MT = { let x = 42 }
should generate
{ "name": "Example", "docstrings": [], "source": { "filepath": "src/Example.res", "line": 1, "col": 1 }, "items": [ { "id": "Example.MT", "name": "MT", "kind": "moduleType", "docstrings": [], "source": { "filepath": "src/Example.res", "line": 1, "col": 13 }, "items": [ { "id": "Example.MT.x", "kind": "value", "name": "x", "signature": "let x: int", "docstrings": [], "source": { "filepath": "src/Example.res", "line": 2, "col": 3 } }] }, { "id": "Example.M", "name": "M", "kind": "module", "moduleType": "Example.MT" <-- this is new! "docstrings": [], "source": { "filepath": "src/Example.res", "line": 5, "col": 8 }, "items": [ { "id": "Example.M.x", "kind": "value", "name": "x", "signature": "let x: int", "docstrings": [], "source": { "filepath": "src/Example.res", "line": 6, "col": 7 } }] }] }
Note in the above example, a moduleType field got added and id of the annotated module type was used as a value.
moduleType
id
I was unsure if I should add this.
See https://github.com/rescript-lang/rescript-vscode/pull/1019
implemented in #1019
Once #1009 is implemented, I think we should include the annotated module type in the generated json:
should generate
Note in the above example, a
moduleType
field got added andid
of the annotated module type was used as a value.