TypeScript
TypeScript copied to clipboard
JSX `JsxNamespacedName` breaks JSDoc + QuickInfo in VSCode
🔎 Search Terms
jsx namespace identifier attribute name js docs quick info language service completion documentation
🕗 Version & Regression Information
- Verified on TS 5.x and VSCode 1.8x
⏯ Playground Link
No response
💻 Code
```tsx
<my-el prop:foo="bar" />
declare namespace JSX {
interface IntrinsicElements {
'my-el': {
/** This appears */
foo: string;
/** This does NOT appear */
'prop:foo': string;
};
}
}
🙁 Actual behavior
Summary
When using namespaced JSX attributes like prop:foo or on:bar, the TypeScript
language service resolves the type correctly, but:
- ❌ JSDoc comments are ignored (both in
.d.tsand when injected via plugin) - ❌
displayPartsfrom customgetQuickInfoAtPosition()overrides are not shown - ❌ Hover rendering is syntactically different, bypassing normal symbol resolution
Observations
-
"foo"shows hover JSDoc properly -
"prop:foo"fails to render documentation - TypeScript does emit the correct type errors and binding
- Even a custom TypeScript language service plugin that injects a QuickInfo
object with
displayPartsanddocumentationcannot override the behavior - VSCode always renders the shadow hover produced by TypeScript internally
Note the sublte differences for quoting behavior:
Inferred Cause
-
JsxNamespacedNameis not fully integrated into the symbol-based resolution flow used for QuickInfo - TS returns a
QuickInfothat VSCode renders but does not allow to be overridden or augmented, breaking hover DX - The rendered hover is syntactically different (highlighted
on:stuffvs quoted"stuff"), indicating it's a non-standard code path
Possible Fix
- Ensure that
JsxNamespacedNameattributes go through the samegetSymbolDisplayPartsDocumentationAndSymbolKind()or equivalent path - Allow plugin-based QuickInfo responses to override this behavior consistently
🙂 Expected behavior
Aligned with non namespaced attributes, show the JSDocs block as it should.
Additional information about the issue
- This affects authoring DX for Custom Elements with namespaced props
- May also affect users of JSX-like DSLs (e.g., Astro, Solid, Gracile, etc.)