Skip to content

Comments

fix: Unwrap InferMatching type if aliased symbol not found#3863

Merged
Mrtenz merged 4 commits intomainfrom
mrtenz/unwrap-infer-matching
Feb 19, 2026
Merged

fix: Unwrap InferMatching type if aliased symbol not found#3863
Mrtenz merged 4 commits intomainfrom
mrtenz/unwrap-infer-matching

Conversation

@Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Feb 19, 2026

This fixes extraction of documentation for type nodes without an aliased symbol, which seems to be the case for the DialogParams (possibly because it's a union).

The diff in the schema after this change:

@@ -85,7 +85,7 @@
     "description": "Display a [dialog](https://docs.metamask.io/snaps/features/custom-ui/dialogs/)\nin the MetaMask UI.",
     "parameters": {
       "type": "{ content: JSXElement } | { id: string } | { type: \"alert\"; content: JSXElement } | { type: \"alert\"; id: string } | { type: \"confirmation\"; content: JSXElement } | { type: \"confirmation\"; id: string } | { type: \"prompt\"; content: JSXElement; placeholder?: string | null } | { type: \"prompt\"; id: string; placeholder?: string | null }",
-      "description": null
+      "description": "The request parameters for the `snap_dialog` method."
     },
     "result": {
       "type": "Json",

Note

Low Risk
Small, localized change to schema generation logic that only affects documentation/metadata extraction, not runtime JSON-RPC behavior.

Overview
Improves generate-schema.mts so schema parameter descriptions are correctly extracted from JSDoc when the referenced type has no aliased symbol (falls back to the identifier’s symbol).

Adds unwrapInferMatchingTypeNode to resolve InferMatching<..., T> wrappers to the underlying type alias before reading JSDoc, fixing missing descriptions for types like DialogParams in the generated schema.json.

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

@Mrtenz Mrtenz marked this pull request as ready for review February 19, 2026 15:53
@Mrtenz Mrtenz requested a review from a team as a code owner February 19, 2026 15:53
@Mrtenz Mrtenz enabled auto-merge February 19, 2026 16:04
@Mrtenz Mrtenz added this pull request to the merge queue Feb 19, 2026
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.58%. Comparing base (225bb57) to head (8acd542).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3863   +/-   ##
=======================================
  Coverage   98.58%   98.58%           
=======================================
  Files         428      428           
  Lines       12372    12372           
  Branches     1922     1922           
=======================================
  Hits        12197    12197           
  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.

Merged via the queue into main with commit 8473769 Feb 19, 2026
246 of 249 checks passed
@Mrtenz Mrtenz deleted the mrtenz/unwrap-infer-matching branch February 19, 2026 16:11
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