Commit f1f8c55
authored
language: Return early if no grammars are added (#48685)
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
thread1 parent 809d545 commit f1f8c55
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
559 | 560 | | |
560 | 561 | | |
561 | 562 | | |
562 | 563 | | |
563 | | - | |
| 564 | + | |
564 | 565 | | |
565 | 566 | | |
566 | 567 | | |
| |||
0 commit comments