Skip to content

Fix namespaced JSX intrinsic completions and hover#4366

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/missing-completion-hover-doc
Open

Fix namespaced JSX intrinsic completions and hover#4366
Copilot wants to merge 4 commits into
mainfrom
copilot/missing-completion-hover-doc

Conversation

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Namespaced JSX intrinsic elements such as <foo:bar /> type-check correctly, but the language service missed attribute completions and hover info for the tag and its attributes.

  • Completions

    • Treat JsxNamespacedName tag nodes, and their child identifiers, as valid JSX opening-element contexts.

    • Restores intrinsic attribute completions in positions like:

      <foo:bar /* completions: foo, bar */ />
  • Hover

    • Resolve hover symbols from the normalized quick-info node.
    • Enables hover for the full namespaced tag and contextual intrinsic attributes.
  • Coverage

    • Adds fourslash regressions for namespaced intrinsic attribute completions and hover documentation.
    • Updates affected quick-info baselines.

Copilot AI and others added 2 commits June 18, 2026 17:31
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing completion and hover document for namespaced JSX elements Fix namespaced JSX intrinsic completions and hover Jun 18, 2026
Copilot AI requested a review from jakebailey June 18, 2026 17:38
@jakebailey jakebailey marked this pull request as ready for review June 18, 2026 17:39
Copilot AI review requested due to automatic review settings June 18, 2026 17:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes language-service hover and completions for namespaced JSX intrinsic elements (e.g. <foo:bar />) by ensuring the LS uses the normalized “quick info” node for symbol resolution and by treating JsxNamespacedName (and its identifiers) as valid JSX element contexts for completion.

Changes:

  • Adjust hover symbol resolution to use the normalized quick-info node (improves hover on JsxNamespacedName and related nodes like import.meta).
  • Extend JSX completion context detection to handle JsxNamespacedName and its child identifiers, restoring intrinsic attribute completions.
  • Add/refresh fourslash coverage and update quick-info baselines for the corrected hover output.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/ls/hover.go Uses the normalized quick-info node for symbol lookup so hover info matches the displayed range/node.
internal/ls/completions.go Treats JsxNamespacedName and identifiers within it as valid JSX opening-element contexts for attribute completions.
internal/fourslash/tests/quickInfoJsxNamespacedIntrinsic_test.go New regression test for quick info on namespaced JSX intrinsic tags/attributes.
internal/fourslash/tests/completionsInJsxTag_test.go New regression test for intrinsic attribute completions on namespaced JSX intrinsic tags.
testdata/baselines/reference/fourslash/quickInfo/quickInfoOnJsxNamespacedName.baseline Baseline update: quick info now produced for the full namespaced tag.
testdata/baselines/reference/fourslash/quickInfo/quickInfoImportMeta.baseline Baseline update: hover now resolves to ImportMeta interface docs (consistent with normalized-node symbol resolution).

<foo:ba/*tag*/r fo/*attr*/o />`
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
defer done()
f.VerifyQuickInfoAt(t, "tag", "(property) JSX.IntrinsicElements[\"foo:bar\"]: {\n foo: boolean;\n bar: string;\n}", "Element docs")
@jakebailey

Copy link
Copy Markdown
Member

@copilot a now non-failing test needs to be removed from internal/fourslash/_scripts/failingTests.txt

The hover.go fix (using rangeNode for symbol lookup) now makes
TestQuickInfoOnNewKeyword01 pass, so it no longer needs to be
listed as a failing test.

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot a now non-failing test needs to be removed from internal/fourslash/_scripts/failingTests.txt

Done. TestQuickInfoOnNewKeyword01 was the test now passing (the hover fix using rangeNode for symbol lookup also fixes hover on the new keyword). Removed it in the latest commit.

Copilot AI requested a review from jakebailey June 18, 2026 19:45
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.

3 participants