Improve performance when detecting JSX auto close - #48622
Merged
Conversation
marcocondrache
force-pushed
the
eslosris
branch
from
February 6, 2026 20:20
dfbcc52 to
2b580bb
Compare
3 tasks
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
jasonsmithio
pushed a commit
to paddleboarddev/paddleboard
that referenced
this pull request
May 31, 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 zed-industries/zed#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
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
Helps zed-industries#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 zed-industries#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
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
Helps zed-industries#48601 <img width="1649" height="1071" alt="image" src="https://github.com/user-attachments/assets/ff3dfee0-cc65-430f-a5fa-b4b4c36e8183" /> `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 --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
Helps zed-industries#48601 <img width="1649" height="1071" alt="image" src="https://github.com/user-attachments/assets/ff3dfee0-cc65-430f-a5fa-b4b4c36e8183" /> `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 --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Helps #48601
syntax_layersdoes 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: