Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: Print module structure with signature to module path #1018

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

aspeddro
Copy link
Contributor

@aspeddro aspeddro commented Jun 9, 2024

The example added in #925 don't print the module M structure

module type Example = {
  /***
  this is an example module type 
  */

  /**
  main type of this module 
  */
  type t

  /**
  function from t to t
  */
  let f: t => t
}

module M: Example = {
  /***
  implementation of Example module type
  */

  /**
  main type 
  */
  type t = int

  /**
  identity function
  */
  let f = (x: int) => x
}
./node_modules/.bin/rescript-tools doc src/Demo.res
{
  "name": "Demo",
  "docstrings": [],
  "source": {
    "filepath": "src/Demo.res",
    "line": 1,
    "col": 1
  },
  "items": [
  {
    "id": "Demo.Example",
    "name": "Example",
    "kind": "moduleType",
    "docstrings": [],
    "source": {
      "filepath": "src/Demo.res",
      "line": 1,
      "col": 13
    },
    "items": [
    {
      "id": "Demo.Example.t",
      "kind": "type",
      "name": "t",
      "signature": "type t",
      "docstrings": ["main type of this module"],
      "source": {
        "filepath": "src/Demo.res",
        "line": 9,
        "col": 3
      }
    }, 
    {
      "id": "Demo.Example.f",
      "kind": "value",
      "name": "f",
      "signature": "let f: t => t",
      "docstrings": ["function from t to t"],
      "source": {
        "filepath": "src/Demo.res",
        "line": 11,
        "col": 3
      }
    }]
  }]
}

@aspeddro aspeddro changed the title Print module structure with signature to module path Tools: Print module structure with signature to module path Jun 9, 2024
@zth zth merged commit 96f3883 into rescript-lang:master Jun 10, 2024
6 checks passed
jfrolich pushed a commit to jfrolich/rescript-vscode that referenced this pull request Sep 3, 2024
…-lang#1018)

* print module structure with signature to module path

* update CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants