rescript-lang / rescript-vscode

Official VSCode plugin for ReScript
MIT License
329 stars 57 forks source link

docgen ignores modules with annotated types #1009

Closed woeps closed 5 months ago

woeps commented 5 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 5 months ago

Seems like #1018 is addressing this.

zth commented 5 months ago

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