rescript-lang / rescript-vscode

Official VSCode plugin for ReScript
MIT License
327 stars 55 forks source link

docgen ignores modules with annotated types #1009

Closed woeps closed 3 months ago

woeps commented 3 months ago

Docgen does not generate json entries for modules annotated with a module type: module M: MT = .... Annotated modules should be just included in the generated json as any other module.

Example

// Example.res
module type MT = {
  let x: int
}

module M: MT = {
  let x = 42
}

generates

{
  "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
      }
    }]
    // Module M is missing here
  }]
}

Note: This behavior was first stated in #902, but was added as a separate issue for transparency.

woeps commented 3 months ago

Seems like #1018 is addressing this.

zth commented 3 months ago

Closed in https://github.com/rescript-lang/rescript-vscode/pull/1018