Improve performance when detecting JSX auto close#48622
Merged
smitbarmase merged 2 commits intozed-industries:mainfrom Feb 10, 2026
Merged
Improve performance when detecting JSX auto close#48622smitbarmase merged 2 commits intozed-industries:mainfrom
smitbarmase merged 2 commits intozed-industries:mainfrom
Conversation
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
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: