Select applicable positions for lsp_ext methods more leniently (#32272)
Closes https://github.com/zed-industries/zed/issues/27238 Release Notes: - Fixed `editor::SwitchSourceHeader` and `editor::ExpandMacroRecursively` not working with text selections
This commit is contained in:
parent
6d95fd9167
commit
fa02bd71c3
4 changed files with 12 additions and 9 deletions
|
@ -42,8 +42,8 @@ where
|
|||
.selections
|
||||
.disjoint_anchors()
|
||||
.iter()
|
||||
.filter(|selection| selection.start == selection.end)
|
||||
.filter_map(|selection| Some((selection.start, selection.start.buffer_id?)))
|
||||
.filter_map(|selection| Some((selection.head(), selection.head().buffer_id?)))
|
||||
.unique_by(|(_, buffer_id)| *buffer_id)
|
||||
.filter_map(|(trigger_anchor, buffer_id)| {
|
||||
let buffer = editor.buffer().read(cx).buffer(buffer_id)?;
|
||||
let language = buffer.read(cx).language_at(trigger_anchor.text_anchor)?;
|
||||
|
@ -53,7 +53,6 @@ where
|
|||
None
|
||||
}
|
||||
})
|
||||
.unique_by(|(_, buffer, _)| buffer.read(cx).remote_id())
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let applicable_buffer_tasks = applicable_buffers
|
||||
|
|
|
@ -132,9 +132,6 @@ pub fn expand_macro_recursively(
|
|||
window: &mut Window,
|
||||
cx: &mut Context<Editor>,
|
||||
) {
|
||||
if editor.selections.count() == 0 {
|
||||
return;
|
||||
}
|
||||
let Some(project) = &editor.project else {
|
||||
return;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue