mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
introduce separate goto_defenition
This commit is contained in:
parent
ad2a5da259
commit
4551155073
2 changed files with 9 additions and 3 deletions
|
@ -392,6 +392,13 @@ impl Analysis {
|
|||
.collect();
|
||||
Ok(res)
|
||||
}
|
||||
pub fn goto_defenition(
|
||||
&self,
|
||||
position: FilePosition,
|
||||
) -> Cancelable<Option<Vec<NavigationTarget>>> {
|
||||
let r = self.approximately_resolve_symbol(position)?;
|
||||
Ok(r.map(|it| it.resolves_to))
|
||||
}
|
||||
/// Resolves reference to definition, but does not gurantee correctness.
|
||||
pub fn approximately_resolve_symbol(
|
||||
&self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue