mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
return ref ranges from gotodef
This commit is contained in:
parent
f9ed8d4d23
commit
3aaf20bd6e
4 changed files with 24 additions and 10 deletions
|
@ -251,7 +251,7 @@ pub struct RangeInfo<T> {
|
|||
}
|
||||
|
||||
impl<T> RangeInfo<T> {
|
||||
fn new(range: TextRange, info: T) -> RangeInfo<T> {
|
||||
pub fn new(range: TextRange, info: T) -> RangeInfo<T> {
|
||||
RangeInfo { range, info }
|
||||
}
|
||||
}
|
||||
|
@ -391,7 +391,7 @@ impl Analysis {
|
|||
pub fn goto_definition(
|
||||
&self,
|
||||
position: FilePosition,
|
||||
) -> Cancelable<Option<Vec<NavigationTarget>>> {
|
||||
) -> Cancelable<Option<RangeInfo<Vec<NavigationTarget>>>> {
|
||||
self.db
|
||||
.catch_canceled(|db| goto_definition::goto_definition(db, position))?
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue