Enable JSX auto-insert in content-mapped files - #64572
Conversation
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
There was a problem hiding this comment.
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
Conditionupdate 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.
|
This seems like a good fix but I'm a bit confused how it fixes the linked issue. |
|
It moves the code to the CM-specific block https://github.com/microsoft/TypeScript/pull/64572/changes#diff-c3b70804ef705332d4984e12414f615177053a389860c92e7eea9db6c4319ce1L374 |
Andrew Branch (andrewbranch)
left a comment
There was a problem hiding this comment.
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 😄
JSX closing tags were not requested for content-mapped files because auto-insert used only the static JavaScript/TypeScript document selector.
Changes