Cache LSP code lens requests (#35207)
This commit is contained in:
parent
cfd5b8ff10
commit
691b3ca238
5 changed files with 291 additions and 89 deletions
|
@ -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")?)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue