introduce separate goto_defenition

This commit is contained in:
Aleksey Kladov 2019-01-05 13:23:34 +03:00
parent ad2a5da259
commit 4551155073
2 changed files with 9 additions and 3 deletions

View file

@ -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,