Do not query for LSP tasks buffers that do not belong to the position given (#28536)
Follow-up of https://github.com/zed-industries/zed/pull/28359 Release Notes: - Fixed a panic when LSP tasks are queried in certain multi buffer excerpts
This commit is contained in:
parent
4a356466b1
commit
804066a047
1 changed files with 4 additions and 0 deletions
|
@ -85,6 +85,10 @@ pub fn lsp_tasks(
|
|||
.map(|(name, buffer_ids)| {
|
||||
let buffers = buffer_ids
|
||||
.iter()
|
||||
.filter(|&&buffer_id| match for_position {
|
||||
Some(for_position) => for_position.buffer_id == Some(buffer_id),
|
||||
None => true,
|
||||
})
|
||||
.filter_map(|&buffer_id| project.read(cx).buffer_for_id(buffer_id, cx))
|
||||
.collect::<Vec<_>>();
|
||||
language_server_for_buffers(project.clone(), name.clone(), buffers, cx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue