zed/crates/language
Marco Mihai Condrache f1f8c5523b
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
https://github.com/zed-industries/zed/pull/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
2026-02-08 17:54:01 +00:00
..
src language: Return early if no grammars are added (#48685) 2026-02-08 17:54:01 +00:00
build.rs Fix context line handline in project diagnostic view 2021-12-21 11:46:47 -08:00
Cargo.toml ztracing: Enable memory profiling and callstack sampling (#47052) 2026-01-17 19:29:19 +00:00
LICENSE-GPL chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00