Cache LSP code lens requests (#35207)

This commit is contained in:
Kirill Bulatov 2025-07-29 09:51:58 +03:00 committed by GitHub
parent cfd5b8ff10
commit 691b3ca238
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 291 additions and 89 deletions

View file

@ -21834,11 +21834,11 @@ impl CodeActionProvider for Entity<Project> {
cx: &mut App,
) -> Task<Result<Vec<CodeAction>>> {
self.update(cx, |project, cx| {
let code_lens = project.code_lens(buffer, range.clone(), cx);
let code_lens_actions = project.code_lens_actions(buffer, range.clone(), cx);
let code_actions = project.code_actions(buffer, range, None, cx);
cx.background_spawn(async move {
let (code_lens, code_actions) = join(code_lens, code_actions).await;
Ok(code_lens
let (code_lens_actions, code_actions) = join(code_lens_actions, code_actions).await;
Ok(code_lens_actions
.context("code lens fetch")?
.into_iter()
.chain(code_actions.context("code action fetch")?)