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
|
@ -26,6 +26,7 @@ impl Default for SelectionGoal {
|
|||
}
|
||||
|
||||
impl<T: Clone> Selection<T> {
|
||||
/// A place where the selection had stopped at.
|
||||
pub fn head(&self) -> T {
|
||||
if self.reversed {
|
||||
self.start.clone()
|
||||
|
@ -34,6 +35,7 @@ impl<T: Clone> Selection<T> {
|
|||
}
|
||||
}
|
||||
|
||||
/// A place where selection was initiated from.
|
||||
pub fn tail(&self) -> T {
|
||||
if self.reversed {
|
||||
self.end.clone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue