Skip to content

rescript-tools doc not extracting docstrings from type definitions #8040

Description

@nathan-tranquilla

Environment

  • ReScript version: 12.0.0
  • OS: macOS
  • Node version: v22.20.0

Problem

The rescript-tools doc command is not extracting docstrings from type definitions and returns an empty items array, even when using proper /** */ documentation comment syntax.

Minimal Reproducible Example

File: src/Demo.res

/**
 * Test
 */
type t = {
  name: string,
  servings: int,
}

Command

npx rescript-tools doc src/Demo.res

Output

{
  "name": "Demo",
  "docstrings": [],
  "source": {
    "filepath": "src/Demo.res",
    "line": 1,
    "col": 1
  },
  "items": []
}

Steps to Reproduce

  • Create a new ReScript project
  • Create Demo.res with the content above
  • Run npx rescript-tools doc src/Demo.res
  • Observe empty items array and missing docstrings

Additional Context

This affects tooling that depends on rescript-tools for documentation extraction (such as codegen)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions