-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
Milestone
Description
π 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
<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 withdisplayPartsanddocumentationcannot 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 same
getSymbolDisplayPartsDocumentationAndSymbolKind()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.)