Skip to content

JSX JsxNamespacedName breaks JSDoc + QuickInfo in VSCodeΒ #61820

Open
@JulianCataldo

Description

@JulianCataldo

πŸ”Ž 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.ts and when injected via plugin)
  • ❌ displayParts from custom getQuickInfoAtPosition() 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 displayParts and documentation
    cannot override the behavior
  • VSCode always renders the shadow hover produced by TypeScript internally
Image Image

Note the sublte differences for quoting behavior:

Image Image

Inferred Cause

  • JsxNamespacedName is not fully integrated into the symbol-based resolution
    flow used for QuickInfo
  • TS returns a QuickInfo that VSCode renders but does not allow to be
    overridden or augmented
    , breaking hover DX
  • The rendered hover is syntactically different (highlighted on:stuff vs
    quoted "stuff"), indicating it's a non-standard code path

Possible Fix

  • Ensure that JsxNamespacedName attributes 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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions