language: Only block the foreground on buffer reparsing when necessary (#43888)

Gist is we only need to block the foreground thread for reparsing if
immediate language changes are useful to the user. That is usually only
the case when they edit the buffer

Release Notes:

- Improved performance of large project searches and project diffs

Co-authored by: David Kleingeld <david@zed.dev>
This commit is contained in:
Lukas Wirth
2025-12-01 14:57:15 +01:00
committed by GitHub
parent 3969109aa3
commit 9af6e82e65
54 changed files with 363 additions and 250 deletions
+2 -2
View File
@@ -830,7 +830,7 @@ impl DapLogView {
async move |buffer, cx| {
let language = language.await.ok();
buffer.update(cx, |buffer, cx| {
buffer.set_language(language, cx);
buffer.set_language_immediate(language, cx);
})
}
})
@@ -901,7 +901,7 @@ impl DapLogView {
async move |_, cx| {
let language = language.await.ok();
buffer.update(cx, |buffer, cx| {
buffer.set_language(language, cx);
buffer.set_language_immediate(language, cx);
})
}
})