Skip to content

Enable JSX auto-insert in content-mapped files - #64572

Merged
Andrew Branch (andrewbranch) merged 3 commits into
mainfrom
copilot/fix-jsx-tag-insertion
Oct 2, 2026
Merged

Andrew Branch (andrewbranch) merged 3 commits into
mainfrom
copilot/fix-jsx-tag-insertion

Conversation

Copilot AI commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

JSX closing tags were not requested for content-mapped files because auto-insert used only the static JavaScript/TypeScript document selector.

Changes

  • Register auto-insert with the selector-scoped features refreshed when content-mapper capabilities change.
  • Dispose conditional update listeners during re-registration to prevent stale VS Code event subscriptions.

Copilot AI and others added 2 commits October 1, 2026 17:01
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix closing JSX tags not inserted in content-mapped files Enable JSX auto-insert in content-mapped files Oct 1, 2026
@jakebailey
Jake Bailey (jakebailey) requested a balanced review from Copilot October 1, 2026 20:04

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.

Copilot review overview

🟢 Approval recommended

The focused changes correctly address content-mapped auto-insert registration and listener cleanup without introducing unresolved issues.

Review effort: Balanced
Findings: None

What changed in this PR

Enables JSX auto-insert for content-mapped files and prevents stale event subscriptions during feature re-registration.

Changes:

  • Registers auto-insert using the dynamically expanded document selector.
  • Disposes Condition update listeners correctly.
File Description
packages/​vscode-typescript/​src/​client.ts Moves auto-insert into selector-scoped feature registration.
packages/​vscode-typescript/​src/​languageFeatures/​util/​dependentRegistration.ts Tracks and disposes condition update listeners.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@jakebailey

Copy link
Copy Markdown
Member

This seems like a good fix but I'm a bit confused how it fixes the linked issue.

@RyanCavanaugh

Copy link
Copy Markdown
Member

@RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh) marked this pull request as ready for review October 2, 2026 16:27

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think at the time I was thinking this was a VS-only feature from the custom message name, but obviously the code is in our VS Code extension, so I guess I didn't think about it hard enough 😄

@andrewbranch
Andrew Branch (andrewbranch) added this pull request to the merge queue Oct 2, 2026
Merged via the queue into main with commit efbf3b5 Oct 2, 2026
30 checks passed
@andrewbranch
Andrew Branch (andrewbranch) deleted the copilot/fix-jsx-tag-insertion branch October 2, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript 7 VS Code extension: closing JSX tags are not inserted in content-mapped files, although tsc --lsp provides them

5 participants