mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Show type actions on ranged type hover
This commit is contained in:
parent
f2246fecef
commit
ec443886ea
3 changed files with 143 additions and 58 deletions
|
@ -113,6 +113,12 @@ impl RangeOrOffset {
|
|||
RangeOrOffset::Offset(_) => panic!("expected a range but got an offset"),
|
||||
}
|
||||
}
|
||||
pub fn range_or_empty(self) -> TextRange {
|
||||
match self {
|
||||
RangeOrOffset::Range(range) => range,
|
||||
RangeOrOffset::Offset(offset) => TextRange::empty(offset),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<RangeOrOffset> for TextRange {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue