Skip to content

Improve performance when detecting JSX auto close#48622

Merged
smitbarmase merged 2 commits intozed-industries:mainfrom
marcocondrache:eslosris
Feb 10, 2026
Merged

Improve performance when detecting JSX auto close#48622
smitbarmase merged 2 commits intozed-industries:mainfrom
marcocondrache:eslosris

Conversation

@marcocondrache
Copy link
Contributor

@marcocondrache marcocondrache commented Feb 6, 2026

Helps #48601

image

syntax_layers does some offset conversion that might require getting some chunks from the rope, which is quite expensive. For detecting autoclose, we only use the language from those syntax layers, so having a short path that skips all the conversion should skip some sum_tree traversals.

I'm pretty sure other places would benefit from this as well, but I haven't searched them yet.

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 6, 2026
@github-actions github-actions bot added the community champion Issues filed by our amazing community champions! 🫶 label Feb 6, 2026
MrSubidubi pushed a commit that referenced this pull request Feb 8, 2026
Helps #48601

Whenever an extension is installed, we call `register_grammars` even
when the grammar list is empty. This unnecessarily increments
reload_count and notifies the LSP store, which clears all languages and
triggers a full reparse.

Clearing languages also emits `LanguageChanged` events for buffers,
causing the editor to perform expensive recomputations (like
#48622) which can block the
main thread for large multibuffers.

This PR addresses the empty-grammar case. If an extension actually adds
a grammar, the underlying issue still exists and will require additional
fixes to fully resolve.

- [ ] Tests or screenshots needed?
- [x] Code Reviewed
- [ ] Manual QA

Release Notes:

- Fixed an issue where installing theme extensions could block the main
thread
Copy link
Member

@smitbarmase smitbarmase left a comment

Choose a reason for hiding this comment

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

Thanks!

@smitbarmase smitbarmase merged commit de7f2f0 into zed-industries:main Feb 10, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement community champion Issues filed by our amazing community champions! 🫶

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants