Skip to content

Comments

feat: Extract multiple example code blocks#3867

Merged
Mrtenz merged 4 commits intomainfrom
mrtenz/extract-multiple-examples
Feb 20, 2026
Merged

feat: Extract multiple example code blocks#3867
Mrtenz merged 4 commits intomainfrom
mrtenz/extract-multiple-examples

Conversation

@Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Feb 20, 2026

This updates the RPC extraction script to support multiple code blocks in a single @example tag. This can be used to, for example, have a manifest and usage within the same example:

/**
 * @example Title
 * ```json name="Manifest"
 * {
 *   "initialPermissions": { ... }
 * }
 * ```
 * ```ts name="Code"
 * // Usage of the permission etc.
 * ```
 */

Which will now be extracted as:

{
  "examples": [
    {
      "title": "Title",
      "examples": [
        {
          "name": "Manifest",
          "language": "json",
          "content": "..."
        },
        {
          "name": "Code",
          "language": "ts",
          "content": "..."
        }
      ]
    }
  ]
}

Note

Medium Risk
Changes the generated schema shape for method examples and the JSDoc parsing regex, which may break downstream consumers or fail on previously tolerated formatting edge cases.

Overview
Enhances the generate-schema.mts extraction logic so a single JSDoc @example tag can contain multiple fenced code blocks, each optionally labeled via name="...".

This changes the emitted method example shape from a single {language, content} to { title, examples: [...] }, formats each block via Prettier using its declared language, and extracts the optional example title separately from the code blocks.

Written by Cursor Bugbot for commit 598ac28. This will update automatically on new commits. Configure here.

@Mrtenz Mrtenz requested a review from a team as a code owner February 20, 2026 11:23
@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.57%. Comparing base (8473769) to head (598ac28).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3867      +/-   ##
==========================================
- Coverage   98.58%   98.57%   -0.01%     
==========================================
  Files         428      425       -3     
  Lines       12372    12311      -61     
  Branches     1922     1919       -3     
==========================================
- Hits        12197    12136      -61     
  Misses        175      175              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@Mrtenz Mrtenz added this pull request to the merge queue Feb 20, 2026
Merged via the queue into main with commit 32accbd Feb 20, 2026
128 of 129 checks passed
@Mrtenz Mrtenz deleted the mrtenz/extract-multiple-examples branch February 20, 2026 15:59
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